/* ============================================
   BACK BUTTON
   ============================================ */
.back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #0071e3;
    background: transparent;
    border: 1px solid #0071e3;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.back-btn:hover {
    background: #0071e3;
    color: white;
    transform: translateY(-50%) translateY(-1px);
}

.back-btn:active {
    transform: translateY(-50%) translateY(0);
}

@media (max-width: 768px) {
    .back-btn {
        position: static;
        transform: none;
        margin-bottom: 15px;
    }

    .header {
        text-align: left;
    }
}

/* ============================================
   FILTERS
   ============================================ */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-buttons::-webkit-scrollbar {
    display: none;
}

.filter-btn,
.specialty-btn {
    padding: 10px 15px;
    border: 1px solid #d2d2d7;
    background: rgba(255, 255, 255, 0.85);
    font-size: clamp(12px, 1.5vw, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: fit-content;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 15px;
    flex: 1;
}

.filter-btn:hover,
.specialty-btn:hover {
    background: #f5f5f7;
}

.filter-btn.active,
.specialty-btn.active {
    background: rgba(0, 127, 255, 0.69);
    color: #fff;
    border-color: rgba(0, 113, 227, 0.4);
    border-radius: 50px;
}

.specialty-filter-container {
    margin: 0 20px;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .specialty-filter-container {
    background: rgba(0, 0, 0, 0.2);
}

.specialty-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.results-count {
    text-align: center;
    color: #86868b;
    font-size: clamp(14px, 1.8vw, 16px);
}

body:not(.theme-dark) .results-count {
    color: #6e6e73;
}

/* ============================================
   COLLEGES GRID
   ============================================ */
.colleges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
    animation: fadeIn 0.4s ease-out;
}

@media (max-width: 599px) {
    .colleges-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 600px) and (max-width: 1024px) {
    .colleges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .colleges-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   COLLEGE CARD
   ============================================ */
.college-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    height: 100%;
    transition: transform 0.2s ease;
    will-change: transform;
}

.college-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.college-card__main {
    padding: 1rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.college-card__footer {
    padding: 0.75rem 1rem;
    width: 100%;
    min-height: 8rem;
    margin-top: auto;
}

/* ============================================
   COLLEGE CARD CONTENT
   ============================================ */
.college-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
    content-visibility: auto;
}

.college-card h3 {
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    width: 100%;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.college-card p {
    font-size: clamp(12px, 1.6vw, 14px);
    line-height: 1.5;
    margin-bottom: 12px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.college-address {
    font-size: clamp(11px, 1.5vw, 13px);
    margin-bottom: 12px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Light theme */
body:not(.theme-dark) .college-card h3,
body:not(.theme-dark) .college-card p,
body:not(.theme-dark) .college-address {
    color: #000000;
    text-shadow: none;
}

/* ============================================
   SPECIALTIES
   ============================================ */
.specialties {
    font-size: clamp(11px, 1.5vw, 13px);
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
}

.specialties strong {
    font-weight: 700;
    font-size: clamp(12px, 1.4vw, 14px);
    margin-bottom: 2px;
    text-align: center;
    width: 100%;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

body:not(.theme-dark) .specialties strong {
    color: #000000;
    text-shadow: none;
}

.specialties ul {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    align-items: center;
    padding: 0 0.4rem;
    list-style: none;
    margin: 0;
    width: 100%;
}

.specialties li {
    padding: 3px 8px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: clamp(9px, 1.2vw, 11px);
    line-height: 1.2;
    color: #ffffff;
    background: rgba(0, 127, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 127, 255, 0.3);
}

body.theme-dark .specialties li {
    background: rgba(59, 158, 255, 0.85);
}

.specialties li:nth-child(n+9) {
    display: none;
}

/* ============================================
   UTILITIES
   ============================================ */
.no-results,
.error {
    text-align: center;
    padding: 60px 20px;
}

.no-results {
    color: #86868b;
}

.error {
    color: #ff3b30;
}

/* ============================================
   LAYOUT
   ============================================ */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 100vw;
    overflow-x: hidden;
}

.filters-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 20px;
}

.colleges-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 2rem 0;
    padding: 1rem;
}

.pagination-btn {
    min-width: 45px;
    height: 45px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 113, 227, 0.2);
    border-radius: 12px;
    color: #0071e3;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pagination-btn:hover {
    transform: translateY(-2px);
    border-color: #0071e3;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.pagination-btn:active {
    transform: translateY(0);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #0071e3 0%, #005bb5 100%);
    color: white;
    border-color: #0071e3;
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.4);
    transform: scale(1.1);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pagination-btn:disabled:hover {
    box-shadow: none;
    border-color: rgba(0, 113, 227, 0.2);
}

.pagination-arrow {
    min-width: 45px;
    font-size: 18px;
}

.pagination-dots {
    padding: 0 8px;
    color: #86868b;
    font-weight: bold;
    user-select: none;
}

body.theme-dark .pagination-btn {
    background: rgba(0, 0, 0, 0.3);
    color: #3b9eff;
    border-color: rgba(59, 158, 255, 0.3);
}

body.theme-dark .pagination-btn:hover {
    border-color: #3b9eff;
    box-shadow: 0 4px 12px rgba(59, 158, 255, 0.3);
}

body.theme-dark .pagination-btn.active {
    background: linear-gradient(135deg, #3b9eff 0%, #0071e3 100%);
}

@media (max-width: 768px) {
    .pagination-btn {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .pagination {
        gap: 6px;
        padding: 1rem 0.5rem;
    }
    
    .pagination-arrow {
        min-width: 40px;
        font-size: 16px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LIQUID GLASS EFFECTS
   ============================================ */
.liquid-glass::before,
.college-card.liquid-glass::before,
.filter-btn::before,
.specialty-filter-container::before,
*::before,
*::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.college-card.liquid-glass::before {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.15) 100%
    ) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.theme-dark .college-card.liquid-glass::before {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 100%
    ) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
