* {
    font-family: 'Exo 2', Sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    min-height: 100vh;
    color: #a8a8a8;
    display: flex;
    flex-direction: column;
}

header {
  background-color: #000000;
  padding: 16px 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Purple Glow Across Top */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(147, 112, 219, 0.1) 20%, 
        rgba(147, 112, 219, 0.3) 40%,
        rgba(147, 112, 219, 0.5) 50%,
        rgba(147, 112, 219, 0.3) 60%,
        rgba(147, 112, 219, 0.1) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.logo-section {
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    align-items: center;
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
    box-shadow: 0 0 0 rgba(98, 77, 227, 0); /* Start with transparent shadow */
}

.logo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(207, 183, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: none;
}

.logo-section:hover {
    box-shadow: 0 4px 8px rgba(98, 77, 227, 0.15);
}

.logo-section:hover::before {
    animation: shimmer 1.2s ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 150%;
    }
}

.logo {
    height: 28px;
    transition: all 0.2s;
    margin-top: 3px;
    margin-right: 4px;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-link {
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a8a8a8;
    padding: 5px 0;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: #9370db;
    visibility: hidden;
    transition: all 0.3s;
}

.nav-link:hover {
    color: #fff;
}

.nav-link:hover::before {
    visibility: visible;
    width: 100%;
}

main {
    flex-grow: 1;
    padding: 30px;
    display: flex;
    justify-content: center;
}

.content-container {
    width: 100%;
}

/* Comparison Layout */
.comparison-layout {
    display: grid;
    height: 82.5vh;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-bottom: 100px;
}

/* Selection Panel */
.selection-panel {
    background-color: #222;
    border-radius: 15px;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

/* Tab Container */
.tab-container {
    display: flex;
    width: 100%;
    background-color: #1a1a1a;
}

.tab-button {
    flex: 1;
    border: none;
    padding: 18px 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
    transition: all 0.3s;
}

.tab-button.active {
    background-color: #222;
    color: white;
}

.tab-button:not(.active) {
    background-color: #1a1a1a;
    color: #555;
}

.tab-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
}

/* Search Container */
.search-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(19, 15, 63, 0.1);
}

.search-button {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 0;
    margin: 0;
    z-index: 1;
}

.search-icon {
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

/* Dropdown */
.dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    margin-top: 5px;
    border: 1px solid #333;
}

.school-item {
    padding: 12px 15px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.2s;
}
  
.school-item:hover {
    background-color: rgba(19, 15, 63, 0.2);
}

/* Selected Schools */
.selected-schools {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(82.5vh - 130px);
    overflow-y: auto;
}

.selected-school {
    background-color: #2c2c2c;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid;
}

.school-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.school-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.school-name {
    font-weight: 500;
    color: white;
    font-size: 15px;
}

.remove-school {
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    padding: 0 5px;
    opacity: 0.6;
    transition: all 0.2s;
}

.remove-school:hover {
    color: #ff6b6b;
    opacity: 1;
}

/* Chart Stats Container */
.chart-stats-container {
    background: linear-gradient(to bottom, rgba(40, 40, 40, 0.5), rgba(30, 30, 30, 0.5));
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #333;
}

.stats-header {
    font-weight: 600;
    margin-bottom: 15px;
    color: white;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.university-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uni-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.uni-color-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
}

/* Graph Panel */
.graph-panel {
    background-color: #222;
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    border: 1px solid #333;
    position: relative;
}

/* University Stats Grid */
.university-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 50px;
    margin-bottom: 50px;
}

/* University Stat Card */
.university-stat-card {
    background-color: rgba(32, 32, 32, 1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    position: relative;
    border-left: 4px solid var(--school-color, #9370db);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.university-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

/* Stat Card Header */
.stat-card-header {
    padding: 15px 20px;
    background-color: rgba(27, 27, 27, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-school-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin-right: 12px;
}

.card-school-name {
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.school-info-container {
    display: flex;
    align-items: center;
}

.stat-card-rank {
    background-color: rgba(50, 50, 50, 0.9);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(80, 80, 80, 0.8);
    border-left: 3px solid var(--school-color, #9370db);
}

/* Weekly Stats Container */
.weekly-stats-container {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    position: relative;
    overscroll-behavior: contain; /* Prevents scroll chaining */
}

/* Styles for Webkit browsers (Chrome, Safari, Edge) */
.weekly-stats-container::-webkit-scrollbar {
    width: 2px;
}

.weekly-stats-container::-webkit-scrollbar-track {
    background: transparent;
}

.weekly-stats-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.stats-fade-indicator {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(32, 32, 32, 0.8), transparent);
    pointer-events: none; /* Make sure it doesn't interfere with scrolling */
    margin-top: -20px; /* Pull it up to overlay the content */
}

/* Hide fade when not needed */
.weekly-stats-container.no-overflow .stats-fade-indicator {
    display: none;
}

/* Week Data */
.week-data {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 50px;
    padding: 12px 20px;
    font-size: 15px;
    align-items: center;
    border-bottom: 1px solid rgba(70, 70, 70, 0.5);
    width: 100%;
}

.week-data:hover {
    background-color: rgba(40, 40, 40, 0.5);
}

.week-data:last-child {
    border-bottom: none;
}

.week-date {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.week-average {
    font-weight: 600;
    color: white;
    font-size: 17.5px;
    text-align: right;
    justify-self: end;
}

.trend-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 30px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 600;
    justify-self: end;
}

.trend-indicator.positive {
    color: rgba(76, 175, 80, 1);
    background-color: rgba(76, 175, 80, 0.4);
}

.trend-indicator.negative {
    color: rgba(244, 67, 54, 1);
    background-color: rgba(244, 67, 54, 0.4);
}

.trend-indicator.neutral {
    color: #fff;
    background-color: rgba(100, 100, 100, 0.8);
}

/* Footer */
footer {
    background-color: #111;
    border-top: 1px solid #333;
    padding: 30px;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 600;
}

.logo-text {
    color: #a8a8a8;
}

.logo-highlight {
    background-image: linear-gradient(to right, rgb(9, 9, 154), rgba(56, 1, 95, 1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #a8a8a8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    color: #666;
    font-size: 12px;
    margin-top: 10px;
}

/* Media Query for 1024px and below */
@media (max-width: 1024px) {
    /* Adjust the main layout to stack vertically */
    .comparison-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        height: auto;
    }
    
    /* Adjust selection panel height */
    .selection-panel {
        height: 300px;
    }
    
    /* Make selected schools display in a row */
    .selected-schools {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        max-height: 210px;
        overflow-y: auto;
    }
    
    /* Adjust the selected school items to fit 3 per row */
    .selected-school {
        width: calc(33.33% - 7px);
        box-sizing: border-box;
        padding: 10px;
    }
    
    /* Adjust school info for smaller container */
    .school-info {
        gap: 8px;
    }
    
    /* Make school logos slightly smaller */
    .school-logo {
        width: 25px;
        height: 25px;
    }
    
    /* Adjust school name font size */
    .school-name {
        font-size: 14px;
    }
    
    /* Make graph panel shorter but still visible */
    .graph-panel {
        height: 850px;
    }
    
    /* Keep stat cards at 2 per row */
    .university-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Adjust content container padding */
    .content-container {
        padding: 0 10px;
    }
    
    /* Ensure the stat cards fit properly */
    .university-stat-card {
        min-width: 0;
    }
    
    /* Make weekly stats more compact */
    .week-data {
        padding: 10px 15px;
    }
    
    /* Slightly reduce font sizes */
    .card-school-name {
        font-size: 18px;
    }
    
    .stat-card-rank {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .week-average {
        font-size: 16px;
    }
    
    /* Ensure the dropdown doesn't overflow */
    .dropdown-list {
        max-height: 250px;
    }
}

@media (max-width: 425px) {
    /* Center the logo and navigation */
    .header-wrap {
        flex-direction: column;
        align-items: center;
        padding: 15px 0;
    }
    
    /* Add some space between logo and navigation */
    .logo-section {
        margin-bottom: 15px;
    }
    
    /* Center the navigation links */
    .nav-links {
        justify-content: center;
    }
    
    .content-container {
        padding: 0;
        gap: 0; /* Reduced gap between selection panel and stat cards */
    }
    
    /* Full-width simple layout */
    .comparison-layout {
        display: block;
        height: auto;
        margin-bottom: 25px; /* Smaller gap between selection panel and first card */
    }
    
    /* Hide Weekly Stats tab completely */
    .tab-button[data-tab="stats"] {
        display: none;
    }
    
    /* Make Select Schools tab take full width */
    .tab-button[data-tab="schools"] {
        width: 100%;
    }
    
    /* Remove tab appearance since there's only one tab */
    .tab-container {
        background-color: transparent;
    }
    
    .selection-panel {
        border-radius: 10px;
        height: 400px;
    }
    
    .graph-panel {
        display: none;
    }
    
    /* Make selection row wrap to single column */
    .selected-school {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* Single column stat cards */
    .university-stats-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    /* Compact school cards */
    .school-info-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .stat-card-header {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .stat-card-rank {
        align-self: center;
    }
    
    /* Make footer more compact */
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px 20px;
    }
}



