/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Body Styling */
body {
    background-color: #f4faff;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* --- Unified Sidebar (Copied from styles.css) --- */
.side-bar {
    width: 280px; /* Desktop width */
    background: linear-gradient(180deg, #002366 0%, #001a4d 100%);
    color: white;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed; /* Fixed position */
    top: 0;
    left: 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001; /* Above overlay */
    transition: transform 0.3s ease-out; /* Transition for mobile */
    overflow-y: auto; /* Allow sidebar scrolling if content overflows */
}

.logo-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px; /* More space */
    text-align: center;
    width: 100%;
}

.logo {
    width: 180px; /* Adjusted size */
    height: auto;
    margin-bottom: 15px;
    opacity: 0.9; /* Slightly less transparent */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.animated-text {
    font-size: 1.1rem; /* Adjusted size */
    margin: 10px 0 5px 0; /* Adjusted margin */
    color: #ffffff;
    font-weight: 600;
}

.animated-subtext {
    font-size: 0.85rem; /* Adjusted size */
    color: rgba(255,255,255,0.8);
    margin-bottom: 15px;
}

.side-bar ul {
    list-style: none;
    width: 100%; /* Full width */
    padding: 0 10px; /* Add padding */
    margin: 0;
    flex-grow: 1; /* Allow list to take remaining space */
}

.side-bar ul li {
    margin: 10px 0; /* Adjusted margin */
}

.nav-item { /* Unified class for sidebar links */
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85); /* Brighter text */
    font-weight: 500;
    padding: 12px 18px; /* Adjusted padding */
    display: flex;
    align-items: center;
    text-align: left;
    border-radius: 8px; /* Smoother radius */
    background: transparent; /* Transparent background */
    border: 1px solid transparent; /* Placeholder for transition */
    transition: all 0.25s ease-out;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    margin-right: 15px; /* More space */
    font-size: 1.1em;
    min-width: 25px;
    text-align: center;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.85);
}

.nav-item .nav-text {
    color: inherit; /* Inherit color from <a> */
    transition: color 0.25s ease-out;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff; /* Full white on hover */
    transform: translateX(5px); /* Subtle move */
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active {
    background: #0054a6; /* Solid active background */
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active i {
    color: #ffffff;
}

/* Ripple Effect */
.ripple:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 1;
    pointer-events: none;
}
.ripple:active:before {
    transform: translate(-50%, -50%) scale(100);
    opacity: 0;
    transition: 0s;
}

/* Sidebar Bottom Links (Desktop) */
.sidebar-bottom-links {
    margin-top: auto; /* Push to bottom */
    padding: 15px 10px 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}
.bottom-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}
.bottom-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.bottom-nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* --- Mobile Menu Specific (Copied from styles.css) --- */
.mobile-menu-icon {
    display: none; /* Hidden by default, shown in media query */
    background: rgba(0, 84, 166, 0.8); /* Make button background blue */
    border: none;
    color: white; /* Icon color */
    font-size: 22px; /* Slightly smaller icon */
    padding: 0; /* Remove padding, use width/height */
    cursor: pointer;
    position: fixed;
    top: 10px; /* Adjust position */
    left: 10px;
    z-index: 1002; /* Above sidebar and overlay */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    width: 44px; /* Touch target size */
    height: 44px;
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.mobile-menu-icon.active {
    background-color: rgba(255, 255, 255, 0.9); /* White background */
    color: #0054a6; /* Blue icon */
}
.mobile-menu-icon:hover {
    background-color: rgba(0, 84, 166, 1);
}
.mobile-menu-icon.active:hover {
     background-color: rgba(255, 255, 255, 1);
}
.nav-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000; /* Below sidebar, above content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0s 0.3s linear;
}
.nav-overlay.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-out, visibility 0s 0s linear;
}


/* --- Main Content --- */
.main-content {
    width: calc(100% - 280px); /* Desktop width */
    margin-left: 280px; /* Desktop margin */
    padding: 30px 40px; /* Adjusted padding */
    text-align: center;
    min-height: calc(100vh - 40px); /* Account for footer height */
    transition: margin-left 0.3s ease-out, width 0.3s ease-out; /* Smooth transition */
    padding-bottom: 60px; /* Ensure space above footer */
}

.athletes-header {
    margin-bottom: 30px; /* Space below header */
}

.section-title { /* Unified title style */
    font-size: 2.2rem;
    color: #002366;
    margin-bottom: 10px; /* Reduced space */
    font-weight: 600;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #0054a6;
    max-width: 700px;
    margin: 0 auto 20px auto; /* Center and add bottom margin */
    line-height: 1.6;
}

/* --- Athletes Grid --- */
.athletes-grid {
    display: grid;
    /* Responsive columns: min 160px, max 1fr */
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px; /* Gap between cards */
    padding: 10px 0; /* Padding top/bottom */
    max-width: 1400px; /* Limit max width */
    margin: 0 auto; /* Center grid */
}

.athlete-card {
    background: white;
    border-radius: 10px; /* Consistent radius */
    box-shadow: 0 4px 12px rgba(0, 35, 102, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    padding: 0; /* Remove padding, image takes full width */
    position: relative;
    z-index: 1;
}

.athlete-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 35, 102, 0.12);
}

.athlete-card:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 84, 166, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.athlete-card:hover:after {
    background: rgba(0, 84, 166, 0.05);
}

.athlete-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover; /* Cover the area */
    display: block; /* Remove extra space */
    border-radius: 10px 10px 0 0; /* Round top corners only if adding text below */
    /* If no text below image, use border-radius: 10px; */
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.athlete-card:hover .athlete-image {
    transform: scale(1.05); /* Slight zoom on card hover */
}

/* Optional: Add athlete name below image */
/*
.athlete-card .athlete-name {
    padding: 10px;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}
*/

/* --- Footer Styling (Copied from styles.css) --- */
.footer {
    text-align: center;
    padding: 15px; /* Increased padding */
    background-color: #001a4d; /* Darker footer */
    color: rgba(255, 255, 255, 0.7);
    width: calc(100% - 280px); /* Adjust based on sidebar width */
    margin-left: 280px;
    font-size: 0.85rem;
    z-index: 100;
    margin-top: auto; /* Push to bottom if content is short */
    transition: margin-left 0.3s ease-out, width 0.3s ease-out;
    position: static; /* Make footer static by default */
}


/* --- Responsive --- */

/* Medium devices (Tablets & Smaller Desktops) */
@media screen and (max-width: 992px) {
    .side-bar {
        transform: translateX(-100%);
        position: fixed;
        width: 280px;
        height: 100%;
    }
    .side-bar.active {
        transform: translateX(0);
    }

    .mobile-menu-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .nav-overlay {
        display: block;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 80px 20px 40px 20px;
    }

    .footer {
        width: 100%;
        margin-left: 0;
        position: static;
        margin-top: 30px;
    }

    .logo {
        width: 150px;
    }
    .sidebar-bottom-links {
        display: block;
    }
    .athletes-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }
    .athlete-image {
        height: 180px; /* Adjust height */
    }
}

/* Small devices (Mobile phones) */
@media screen and (max-width: 768px) {
    .main-content {
        padding: 75px 15px 30px 15px;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .section-subtitle {
        font-size: 1rem;
    }
     .athletes-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
     .athlete-image {
        height: 150px; /* Adjust height */
    }
    .footer {
        padding: 10px;
        font-size: 0.8rem;
    }

    /* Mobile Sidebar Expansion */
    .side-bar .logo { width: 180px; margin-bottom: 20px; }
    .side-bar .nav-item { padding: 15px 20px; font-size: 1rem; margin: 12px 0; }
    .side-bar .nav-item i { font-size: 1.2em; margin-right: 18px; }
    .sidebar-bottom-links { padding: 20px 15px 15px 15px; }
    .bottom-nav-item { padding: 12px 15px; font-size: 0.95rem; }
    .bottom-nav-item i { font-size: 1.1rem; }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
     .main-content {
        padding: 70px 10px 20px 10px;
    }
    .logo { width: 120px; }
    .animated-text { font-size: 1rem; }
    .animated-subtext { font-size: 0.8rem; }
    .nav-item { padding: 12px 15px; font-size: 0.95rem; }
    .nav-item i { margin-right: 12px; }

    .section-title { font-size: 1.5rem; }
    .section-subtitle { font-size: 0.9rem; }

    .athletes-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
     .athlete-image {
        height: 130px; /* Adjust height */
    }
}

/* Landscape orientation fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
   .side-bar { overflow-y: auto; }
}

/* Touch-friendly adjustments */
@media (hover: none) {
    .nav-item:hover { background: transparent; transform: none; }
    .nav-item:active { background: rgba(255, 255, 255, 0.1); }
    .athlete-card:hover { transform: none; box-shadow: 0 4px 12px rgba(0, 35, 102, 0.08); }
    .athlete-card:hover .athlete-image { transform: none; }
}

/* SweetAlert Image Modal Style */
.swal-athlete-image {
    max-width: 90% !important;
    max-height: 80vh !important;
    border-radius: 8px;
    object-fit: contain;
}

/* --- Athletes Filter --- */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: #f4faff;
    padding: 15px 20px;
    border-radius: 10px;
    border-bottom: 1px solid #e0eaf8;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-section label {
    font-weight: 600;
    color: #002366;
    font-size: 0.95rem;
}

.filter-select {
    padding: 8px 15px;
    border: 1px solid #ccdcf0;
    border-radius: 6px;
    background-color: #ffffff;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 150px;
}

.filter-select:focus {
    border-color: #0054a6;
    box-shadow: 0 0 0 2px rgba(0, 84, 166, 0.2);
    outline: none;
}

.reset-button {
    background-color: #f1f5fa;
    color: #0054a6;
    border: 1px solid #ccdcf0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.reset-button:hover {
    background-color: #e4ecf6;
}

.reset-button:active {
    background-color: #d6e1f0;
}

.no-results-message {
    background: rgba(255, 248, 230, 0.9);
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 15px;
    margin: 20px auto;
    max-width: 500px;
    color: #856404;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- Athlete Info --- */
.athlete-info {
    padding: 10px;
    font-size: 0.85rem;
    color: #333;
    background: #f9fbff;
    border-top: 1px solid #edf2f9;
}

.athlete-batch, .athlete-category {
    margin: 2px 0;
}

.athlete-batch {
    font-weight: 600;
    color: #0054a6;
}

.athlete-category {
    color: #002366;
}

/* --- Athlete Modal Styling --- */
.athlete-modal-popup {
    border-radius: 12px;
    padding: 0 !important;
    overflow: hidden;
    max-width: 95vw !important;
    width: auto !important;
    margin: 0 !important;
}

.athlete-modal-html-container {
    padding: 0 !important;
    margin: 0 !important;
}

/* Override SweetAlert container padding */
.swal2-container {
    padding: 10px !important;
}

.swal2-html-container {
    margin: 0 !important;
}

.athlete-modal-title {
    color: #002366;
    font-size: 1.4rem;
    margin-top: 15px;
    font-weight: 600;
    padding: 0 10px;
}

.athlete-modal-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
    margin-bottom: 15px;
}

.athlete-modal-batch, .athlete-modal-category {
    background: #f4faff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #0054a6;
    font-weight: 500;
    border: 1px solid #e0eaf8;
    margin: 0;
}

.swal-athlete-image {
    max-width: 100% !important;
    max-height: 80vh !important;
    border-radius: 8px;
    object-fit: contain;
    margin: 0 auto;
}

/* --- Responsive Filters --- */
@media screen and (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .filter-section label {
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .filter-container {
        padding: 10px;
        gap: 10px;
    }
    
    .filter-select, .reset-button {
        padding: 7px 12px;
        font-size: 0.85rem;
    }
    
    .athlete-modal-info {
        flex-direction: column;
        gap: 8px;
    }
}

