/* Reset or minimal base styles - Bootstrap will provide most styling */
body {
    font-family: sans-serif; /* Basic font fallback */
    background-color: #f8f9fa; /* Light grey background */
    color: #212529; /* Default text color */
    padding-top: 20px; /* Add some top padding */
}

/* Dashboard card styling */
.card {
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); /* Subtle shadow */
}

/* Button group styling */
.btn-group {
    margin-bottom: 1rem;
}

.btn-group .btn {
    padding: 0.5rem 1rem; /* Slightly more padding */
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-group .btn i {
    font-size: 1.2rem; /* Slightly larger icon */
    vertical-align: middle;
}

.btn-group .btn-md {
    padding: 0.5rem 1rem; /* Ensure consistent padding */
}

/* Form element styling */
.form-label {
    font-weight: 500;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd; /* Bootstrap primary color */
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Custom styling for accreditation form */
.card .card-body {
    /*background: #fff;*/
    border-radius: 1rem;
}

.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

.form-select-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Modal styling */
.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Custom styling for form elements */
.bg-light-subtle {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

.text-primary {
    color: #0d6efd !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.25rem;
    }
    
    .form-control-lg, .form-select-lg {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.25rem;
        font-size: 1rem;
    }
}

/* Add any highly specific custom styles here if Bootstrap doesn't cover them,
   or for overrides. For now, keeping it minimal. */

.attendees-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

.attendees-table th, .attendees-table td {
    border: 1px solid #dee2e6; /* Bootstrap's default table border color */
    padding: 0.75rem; /* Bootstrap's default table cell padding */
    text-align: left;
}

.attendees-table thead th {
    background-color: #f8f9fa; /* Light background for headers */
    font-weight: bold;
}

.sortable-header {
    cursor: pointer;
}

.sort-arrow {
    margin-left: 5px;
    font-size: 0.8em;
}

.sorted-asc .sort-arrow::after {
    content: ' \25B2'; /* Up arrow */
}

.sorted-desc .sort-arrow::after {
    content: ' \25BC'; /* Down arrow */
}

/* Collapsible club list styles */
.club-list-container .card-header {
    cursor: pointer;
    background-color: #f8f9fa;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.club-list-container .card-header h4 {
    margin-bottom: 0;
    font-weight: 500;
}

.club-list-container .card-header i {
    transition: transform 0.2s ease;
}

.club-list-container .card-header i.fa-chevron-up {
    transform: rotate(180deg);
}

.club-list-container .card-body {
    padding: 1.25rem;
}

.club-search-input {
    margin-bottom: 1rem;
}

#clubSearch {
    margin-top: 0.5rem;
}

#showAllClubsBtn {
    margin-top: 0.5rem;
    display: inline-block;
    font-size: 0.875rem;
}

/* Club search results styling */
#club_search_results {
    z-index: 1000;
    position: absolute;
    width: calc(100% - 2rem);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
}

#club_search_results .list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
}

#club_search_results .list-group-item:hover {
    background-color: #f8f9fa;
}

#club_search_results .list-group-item:last-child {
    border-bottom: none;
}

.club-row {
    transition: background-color 0.2s ease;
}

.club-row:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    max-height: 700px;
    overflow-y: auto;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark mode styles - Enhanced for Bootstrap 5.3.3 compatibility */

/* Loading state classes to prevent FOUC */
html.dark-theme-loading {
    background-color: #121212;
    color: #e0e0e0;
}

html.light-theme-loading {
    background-color: #ffffff;
    color: #212529;
}

/* Main dark mode styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

/* Navbar styling */
body.dark-mode .navbar {
    background-color: #1e1e1e !important;
}

body.dark-mode .navbar-brand {
    color: #f8f9fa !important;
}

body.dark-mode .navbar-nav .nav-item .nav-link {
    color: #e0e0e0 !important;
}

body.dark-mode .navbar-nav .nav-item .nav-link:hover {
    color: #f8f9fa !important;
}

/* Card styling */
body.dark-mode .card {
    background-color: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .card-header {
    background-color: #2d2d2d;
    border-color: #333;
    color: #e0e0e0;
}

/* Form controls */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #2d2d2d;
    border-color: #0d6efd;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

body.dark-mode .form-control::placeholder {
    color: #adb5bd;
}

/* Table styling */
body.dark-mode .table th,
body.dark-mode .table td {
    border-color: #333;
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-mode .table thead th {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #333;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: #252525;
}

body.dark-mode .attendees-table th,
body.dark-mode .attendees-table td {
    border-color: #333;
}

body.dark-mode .attendees-table thead th {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Alert styling */
body.dark-mode .alert {
    color: #e0e0e0;
    background-color: #2d2d2d;
    border-color: #444;
}

body.dark-mode .alert-info {
    background-color: #1a2332;
    border-color: #2c5aa0;
    color: #9ec5fe;
}

body.dark-mode .alert-success {
    background-color: #0f2419;
    border-color: #0a3622;
    color: #75b798;
}

body.dark-mode .alert-warning {
    background-color: #332701;
    border-color: #664d03;
    color: #ffda6a;
}

body.dark-mode .alert-danger {
    background-color: #2c0b0e;
    border-color: #58151c;
    color: #ea868f;
}

/* Button styling */
body.dark-mode .btn-outline-light {
    color: #f8f9fa;
    border-color: #f8f9fa;
}

body.dark-mode .btn-outline-light:hover {
    background-color: #f8f9fa;
    color: #121212 !important;
}

body.dark-mode .btn-outline-primary {
    color: #6ea8fe;
    border-color: #6ea8fe;
}

body.dark-mode .btn-outline-primary:hover {
    background-color: #6ea8fe;
    color: #000;
}

/* Dropdown styling */
body.dark-mode .dropdown-menu {
    background-color: #1e1e1e;
    border-color: #333;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
    background-color: #333;
    color: #f8f9fa;
}

body.dark-mode .dropdown-item.active {
    background-color: #0d6efd;
    color: #fff;
}

/* Modal styling */
body.dark-mode .modal-content {
    background-color: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    border-color: #333;
}

body.dark-mode .modal-footer {
    border-color: #333;
}

body.dark-mode .modal-backdrop {
    background-color: #000;
}

/* Badge styling */
body.dark-mode .badge {
    color: #fff;
}

body.dark-mode .badge.bg-primary {
    background-color: #0d6efd !important;
}

/* Footer styling */
body.dark-mode .footer {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

/* Scrollbar styling */
body.dark-mode .table-responsive::-webkit-scrollbar-track {
    background: #2d2d2d;
}

body.dark-mode .table-responsive::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-mode .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Custom dropdown list styling for dark mode */
body.dark-mode .dropdown-list {
    background: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .dropdown-item.no-results {
    color: #adb5bd;
}

body.dark-mode #club_search_results {
    background: #1e1e1e;
    border-color: #333;
}

body.dark-mode #club_search_results .list-group-item {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #333;
}

body.dark-mode #club_search_results .list-group-item:hover {
    background-color: #333;
}

/* Custom dropdown styles for club search */
.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.25rem;
    /* Ensure it's properly positioned for mobile */
    width: calc(100% - 2rem);
    left: 1rem;
    right: 1rem;
    /* Improve touch target sizes */
    -webkit-tap-highlight-color: transparent;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    /* Ensure good touch targets */
    min-height: 44px;
    display: flex;
    align-items: center;
}

.dropdown-item:hover,
.dropdown-item.selected {
    background-color: #e9ecef;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.no-results {
    color: #6c757d;
    font-style: italic;
}

/* Mobile-friendly dropdown adjustments */
@media (max-width: 768px) {
    .dropdown-list {
        max-height: 150px;
        border-radius: 0.5rem;
    }
    
    .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Ensure proper positioning for club search container */
#club_search_container {
    position: relative;
}

/* Improved touch handling for mobile devices */
@media (max-width: 768px) {
    .dropdown-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
        font-size: 1rem;
    }
    
    /* Ensure dropdown is visible on mobile */
    .dropdown-list {
        position: absolute;
        width: calc(100% - 2rem) !important;
        left: 1rem !important;
        right: 1rem !important;
        top: 100% !important;
        margin-top: 0.25rem !important;
    }
}