:root {
  /* Primary color scheme */
  --primary-color: #3498db;      /* Blue */
  --secondary-color: #ffb915;    /* Green */
  --accent-color: #e74c3c;       /* Red */
  
  /* Neutral colors */
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gray-color: #f5f5f5;
  
  /* Text colors */
  --text-dark: #333333;
  --text-light: #ffffff;
  --text-muted: #6c757d;
  
  /* Breakpoint variables */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
}

/* Responsive Styles
   ----------------------------------------
   All responsive styles are gathered here for better maintainability
   Using min-width queries (mobile-first approach)
*/

/* Base styles (mobile-first, no media query needed) */
body {
  padding-bottom: 70px; /* Space for fixed footer on mobile */
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: #f8f9fa;
}

/* Mobile-specific styles (no media query needed - default) */
.navbar-custom {
  padding: 0.5rem 1rem;
}

.navbar-brand {
  font-size: 1.25rem;
}

.card {
  border: none;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  overflow: hidden;
}

.card-header {
  border-top-left-radius: 0.75rem !important;
  border-top-right-radius: 0.75rem !important;
  padding: 0.75rem 1rem;
  border-bottom: none;
}

.card-body {
  padding: 1.25rem;
}

.form-control {
  height: 3rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ced4da;
}

.btn {
  padding: 0.625rem 1rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

/* Extra small button for mobile */
.btn-sm-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  min-height: 32px;
  min-width: 32px;
}

.mobile-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.75rem;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

.nav-link, .btn {
  padding: 0.75rem 1rem;
  min-height: 44px; /* Minimum touch target size */
}

input, select, textarea, button {
  font-size: 16px !important; /* Prevents iOS zoom on focus */
}

h1, .h1 {
  font-size: 1.75rem;
}

h4, .h4 {
  font-size: 1.25rem;
}

.lead {
  font-size: 1.1rem;
}

.container {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Base dropdown menu styles - mobile first */
.navbar-collapse .dropdown-menu {
  width: 100%;
  position: absolute;
  will-change: transform;
  top: 0px;
  left: 0px;
  transform: translate3d(0px, 38px, 0px);
}

.logout-form button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Small devices (sm) and up */
@media (min-width: var(--breakpoint-sm)) {
  /* Small device specific styles here */
}

/* Medium devices (md) and up */
@media (min-width: var(--breakpoint-md)) {
  body {
    padding-bottom: 0; /* Remove mobile footer padding */
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .container {
    padding-left: initial;
    padding-right: initial;
  }
  
  h1, .h1 {
    font-size: 2rem;
  }
  
  h4, .h4 {
    font-size: 1.5rem;
  }
  
  .lead {
    font-size: 1.25rem;
  }
  
  .navbar-collapse .dropdown-menu {
    width: auto;
    position: absolute;
    left: auto;
    right: auto;
  }
  
  .navbar-collapse .dropdown-menu-end {
    right: 0;
    left: auto;
  }
  
  .logout-form button {
    display: inline;
    width: auto;
  }
}

/* Fix for card layouts between medium and large viewports */
@media (min-width: var(--breakpoint-md)) and (max-width: 1199px) {
  /* Ensure consistent card width */
  .row-cols-md-2 > * {
    width: 50%;
    max-width: 50%;
    flex: 0 0 auto;
  }
  
  /* Give cards more breathing room */
  .card {
    margin-bottom: 1.5rem;
  }
  
  /* Ensure buttons maintain proper spacing */
  .event-card .button-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .event-card .button-container .btn-group {
    margin-top: 0.75rem;
    width: 100%;
    display: flex;
  }
  
  .event-card .button-container .btn-group .btn {
    flex: 1;
  }
  
  .event-card .btn-outline-primary {
    width: 100%;
  }
}

/* Large devices (lg) and up */
@media (min-width: var(--breakpoint-lg)) {
  .event-card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
  }
}

/* Extra large devices (xl) and up */
@media (min-width: 1200px) {
  /* Ensure cards maintain proper width in larger viewports */
  .row-cols-lg-3 > * {
    width: 33.333333%;
    max-width: 33.333333%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Restore horizontal button layout */
  .event-card .button-container {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
  }
  
  .event-card .btn-outline-primary {
    width: auto;
    min-width: 120px;
  }
  
  .event-card .button-container .btn-group {
    width: auto;
  }
}

/* Hide redundant category badges in event cards */
/* They're already categorized in the overview */
.card-title .badge.bg-primary,
.card-title .badge.bg-info,
.card-title .badge.bg-secondary {
  display: none;
}

/* Show the badges in the event detail page */
body.event-detail .card-title .badge {
  display: inline-flex !important;
}

/* Override Bootstrap classes with custom colors */
.navbar-custom {
  background-color: var(--gray-color);
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link {
  color: var(--text-dark);
}

.navbar-custom .nav-link:hover {
  color: var(--primary-color);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-accent {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--text-light);
}

/* Custom info button styling to match the new badge color */
.btn-info {
  background-color: #ffd013 !important;
  border-color: #ffd013 !important;
  color: var(--text-dark) !important;
}

.btn-info:hover, .btn-info:focus, .btn-info:active {
  background-color: #e6bb11 !important;
  border-color: #e6bb11 !important;
  color: var(--text-dark) !important;
}

.btn-outline-info {
  color: #ffd013 !important;
  border-color: #ffd013 !important;
  background-color: transparent !important;
}

.btn-outline-info:hover, .btn-outline-info:focus, .btn-outline-info:active {
  background-color: #ffd013 !important;
  border-color: #ffd013 !important;
  color: var(--text-dark) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.text-secondary {
  color: var(--secondary-color) !important;
}

.text-accent {
  color: var(--accent-color) !important;
}

.bg-primary-custom {
  background-color: var(--dark-color);
  color: var(--text-light);
}

.bg-secondary-custom {
  background-color: var(--secondary-color);
  color: var(--text-light);
}

.bg-accent-custom {
  background-color: var(--accent-color);
  color: var(--text-light);
}

.card-header-primary {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.footer-custom {
  background-color: var(--gray-color);
  color: var(--text-dark);
  border-top: 1px solid #e0e0e0;
}

/* Logo styling */
.logo-img {
  height: 30px;
  margin-right: 10px;
}

/* Form controls */
.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.25rem rgba(231, 76, 60, 0.25);
}

/* Card styles */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  overflow: hidden;
}

.card-header {
  padding: 1rem;
  border-bottom: none;
}

.card-body {
  padding: 1.5rem;
}

/* Alert styles */
.alert {
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
}

.alert-info {
  background-color: #f5f5f5;
  border-color: #e0e0e0;
  color: var(--text-dark);
}

.alert-success {
  background-color: #f5f5f5;
  border-color: #e0e0e0;
  color: var(--text-dark);
}

.alert-danger {
  background-color: #f5f5f5;
  border-color: #e0e0e0;
  color: var(--text-dark);
}

/* Button styles */
.btn-accent:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}

/* Event cards styling */
.card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-card {
    display: flex;
    flex-direction: column;
}

.event-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.event-card .btn {
    padding: 0.375rem 0.75rem;
    white-space: normal;
    line-height: 1.3;
    height: auto;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-card .btn-outline-primary {
    min-width: 120px;
}

.event-card .btn-group .btn {
    min-width: 80px;
}

/* Button container styles */
.button-container {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive button layout - Small to medium devices */
@media (max-width: 991px) {
    .button-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .button-container .btn-group {
        margin-top: 10px;
        display: flex;
        width: 100%;
    }
    
    .button-container .btn-group .btn {
        flex: 1;
    }
    
    .event-card .btn-outline-primary {
        width: 100%;
        text-align: center;
    }
}

/* Responsive button layout - Large devices */
@media (min-width: 992px) and (max-width: 1199px) {
    .button-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .button-container .btn-group {
        margin-top: 10px;
        display: flex;
        width: 100%;
    }
    
    .button-container .btn-group .btn {
        flex: 1;
    }
    
    .event-card .btn-outline-primary {
        width: 100%;
        text-align: center;
    }
}

/* Responsive button layout - Extra large devices */
@media (min-width: 1200px) {
    .button-container {
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    .button-container .btn-group {
        width: auto;
    }
    
    .event-card .btn-outline-primary {
        width: auto;
    }
}

/* Carpooling form styling */
#seats-field.disabled {
    opacity: 0.7;
}

.bg-light {
    background-color: #f8f9fa;
}

/* Account dropdown styling */
.dropdown-toggle {
  cursor: pointer;
}

.dropdown-item {
  transition: background-color 0.2s, color 0.2s;
  padding: 0.5rem 1.5rem;
}

.dropdown-item:hover {
  background-color: var(--gray-color);
  color: var(--primary-color);
}

.dropdown-item.active,
a.dropdown-item.active {
  background-color: transparent !important;
  color: var(--text-dark) !important;
  font-weight: bold;
}

.dropdown-item:active,
a.dropdown-item:active {
  background-color: var(--gray-color) !important;
  color: var(--primary-color) !important;
}

/* Ensure the logout button is styled consistently with other items */
.dropdown-menu form {
  width: 100%;
}

.dropdown-menu .dropdown-item {
  text-align: left;
  border: none;
  background: none;
  width: 100%;
  font-weight: normal;
  padding: 0.5rem 1.5rem;
}

/* Add any additional custom styles here */

/* Mobile-specific styles */
@media (max-width: 767px) {
    body {
        padding-bottom: 70px; /* Space for fixed footer on mobile */
    }
    .navbar-custom {
        padding: 0.5rem 1rem;
    }
    .navbar-brand {
        font-size: 1.25rem;
    }
    .card {
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .card-header {
        border-top-left-radius: 0.75rem !important;
        border-top-right-radius: 0.75rem !important;
        padding: 0.75rem 1rem;
    }
    .form-control {
        height: 3rem;
        font-size: 1rem;
    }
    .btn {
        padding: 0.625rem 1rem;
        font-size: 1rem;
    }
    .mobile-footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        z-index: 1000;
        padding: 0.75rem;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
    }
}

/* Event cards styling */
.card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-card {
    display: flex;
    flex-direction: column;
}

.event-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.event-card .btn {
    padding: 0.375rem 0.75rem;
}

.event-card .btn-outline-primary {
    min-width: 120px;
}

.event-card .btn-group .btn {
    min-width: 80px;
}

.button-container {
    margin-top: auto;
}

@media (min-width: 992px) {
    .button-container {
        display: flex;
        justify-content: space-between;
    }
}

/* Carpooling form styling */
#seats-field.disabled {
    opacity: 0.7;
}

.bg-light {
    background-color: #f8f9fa;
}

/* Responsive dropdown menu */
@media (max-width: 767px) {
    .navbar-collapse .dropdown-menu {
        width: 100%;
        position: absolute;
        will-change: transform;
        top: 0px;
        left: 0px;
        transform: translate3d(0px, 38px, 0px);
    }
    
    /* Mobile footer dropup menu should go upward */
    .mobile-footer .dropdown-menu {
        position: absolute;
        width: auto;
        min-width: 200px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Logout form and button */
.logout-form {
  margin-bottom: 0;
}

.logout-form button {
  cursor: pointer;
  font-weight: inherit;
  font-size: inherit;
  padding: 0.5rem 0;
}

.navbar-custom .logout-form button:hover {
  color: var(--primary-color);
}

/* Account dropdown styling */
.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  min-width: 200px;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.dropdown-item {
  transition: background-color 0.2s, color 0.2s;
  padding: 0.5rem 1.5rem;
}

.dropdown-item:hover {
  background-color: var(--gray-color);
  color: var(--primary-color);
}

.dropdown-item.active,
a.dropdown-item.active {
  background-color: transparent !important;
  color: var(--text-dark) !important;
  font-weight: bold;
}

.dropdown-item:active,
a.dropdown-item:active {
  background-color: var(--gray-color) !important;
  color: var(--primary-color) !important;
}

/* Ensure the logout button is styled consistently with other items */
.dropdown-menu form {
  width: 100%;
}

.dropdown-menu .dropdown-item {
  text-align: left;
  border: none;
  background: none;
  width: 100%;
  font-weight: normal;
  padding: 0.5rem 1.5rem;
}

/* Past events styling */
.past-event {
    opacity: 0.9;
}

.past-event .card-title {
    color: #6c757d;
}

.past-event .card-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.past-event .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.past-event .btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
}

/* Event category styling */
.event-card.event-major .card-header {
    border-left: 4px solid var(--primary-color);
}

.event-card.event-minor .card-header {
    border-left: 4px solid var(--secondary-color);
}

.event-card.event-custom .card-header {
    border-left: 4px solid var(--accent-color);
}

/* Past event category styling */
.past-event.event-major .card-header {
    border-left: 4px solid var(--primary-color);
    opacity: 0.8;
}

.past-event.event-minor .card-header {
    border-left: 4px solid var(--secondary-color);
    opacity: 0.8;
}

.past-event.event-custom .card-header {
    border-left: 4px solid var(--accent-color);
    opacity: 0.8;
}

/* Event category detail styling */
.event-major .card-header {
    border-left: 5px solid var(--primary-color);
}

.event-minor .card-header {
    border-left: 5px solid var(--secondary-color);
}

.event-custom .card-header {
    border-left: 5px solid var(--accent-color);
}

/* Add this at the end of your custom.css to support Bootstrap icons */
.bi {
  display: inline-block;
  font-size: 1.25rem;
  line-height: 1;
  vertical-align: text-bottom;
}

/* Make Bootstrap Icons behave like FontAwesome in places it's used */
.bi-check-circle {
  color: #28a745;
}

.bi-x-circle {
  color: #dc3545;
}

.bi-car-front {
  color: #17a2b8;
}

.bi-person {
  color: #ffc107;
}

/* Mobile footer icon styling */
.mobile-footer .bi {
  display: block;
  margin: 0 auto;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* Fix for mobile footer text wrapping */
.mobile-footer small {
  display: block;
  font-size: 0.7rem;
  line-height: 1.2;
  max-width: 100%;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  hyphens: auto;
}

.mobile-footer a, 
.mobile-footer button {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.mobile-footer .col-auto {
  padding-left: 4px;
  padding-right: 4px;
  min-width: 65px;
  max-width: 75px;
}

/* Mobile footer dropdown styling */
.mobile-footer .dropdown-menu {
  bottom: 100%;
  top: auto;
  margin-bottom: 0.5rem;
}

/* Ensure mobile footer dropdown items have proper styling */
.mobile-footer .dropdown-menu .dropdown-item,
.mobile-footer .dropdown-menu a.dropdown-item {
  color: var(--text-dark) !important;
  background-color: white !important;
}

.mobile-footer .dropdown-menu .dropdown-item.active,
.mobile-footer .dropdown-menu a.dropdown-item.active {
  background-color: white !important;
  color: var(--text-dark) !important;
  font-weight: bold !important;
}

.mobile-footer .dropdown-menu .dropdown-item:hover,
.mobile-footer .dropdown-menu a.dropdown-item:hover {
  background-color: var(--gray-color) !important;
  color: var(--primary-color) !important;
}

.mobile-footer .dropdown-menu .dropdown-item:active,
.mobile-footer .dropdown-menu a.dropdown-item:active {
  background-color: var(--gray-color) !important;
  color: var(--primary-color) !important;
}

/* Smaller screens need tighter spacing */
@media (max-width: 375px) {
  .mobile-footer .bi {
    font-size: 1.3rem;
  }
  
  .mobile-footer small {
    font-size: 0.65rem;
  }
  
  .mobile-footer .col-auto {
    padding-left: 2px;
    padding-right: 2px;
    min-width: 60px;
    max-width: 70px;
  }
}

/* Badge Styling */
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35em 0.65em;
  border-radius: 0.375rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

/* Badge colors */
.badge.bg-primary {
  background-color: var(--primary-color) !important;
  color: var(--text-light);
}

.badge.bg-secondary {
  background-color: #6c757d !important;
  color: var(--text-light);
}

.badge.bg-success {
  background-color: #28a745 !important;
  color: var(--text-light);
}

.badge.bg-danger {
  background-color: var(--accent-color) !important;
  color: var(--text-light);
}

.badge.bg-warning {
  background-color: var(--secondary-color) !important;
  color: var(--text-dark);
}

.badge.bg-info {
  background-color: #17a2b8 !important;
  color: var(--text-light);
}

.badge.bg-dark {
  background-color: var(--dark-color) !important;
  color: var(--text-light);
}

/* Event category badges - custom styling */
/* Punktspiel - using the bg-primary class that's already in the HTML */
.badge.bg-primary {
  background-color: #0056b3 !important;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Freizeitturnier - using the bg-info class that's already in the HTML */
.badge.bg-info {
  background-color: #ffd013 !important;
  color: var(--text-dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Anderes Event - using the bg-secondary class that's already in the HTML */
.badge.bg-secondary {
  background-color: #6c757d !important;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Add specific styles for participation status badges */
/* Participation status - using existing classes */
.badge.bg-success {
  background-color: #28a745 !important;
  background-image: linear-gradient(45deg, #28a745, #20c997);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.bg-danger {
  background-color: #dc3545 !important;
  background-image: linear-gradient(45deg, #dc3545, #e74c3c);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* User role badges - keeping existing styles */
.badge.bg-dark {
  background-color: #343a40 !important;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Rounded pill variant */
.badge.rounded-pill {
  border-radius: 50rem;
  padding-left: 0.65em;
  padding-right: 0.65em;
}

/* Badge hover effects */
.badge:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Badge placement spacing */
.badge.ms-1 {
  margin-left: 0.25rem !important;
}

.badge.ms-2 {
  margin-left: 0.5rem !important;
}

.badge.me-2 {
  margin-right: 0.5rem !important;
}

/* Event detail card header responsive improvements */
@media (max-width: 767px) {
  .card-header .d-flex.flex-column {
    width: 100%;
  }
  
  .card-header .btn {
    flex: 1 1 auto;
    min-width: fit-content;
  }
  
  .card-header .gap-2 {
    gap: 0.5rem !important;
  }
}
