/* ================================
   MODERN UNIVERSITY ARCHIVE
   Minimalist & Clean Design
   ================================ */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --dark: #1a202c;
    --gray: #718096;
    --light: #f7fafc;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

/* ================================
   HEADER SECTION
   ================================ */

.archive-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 80px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.archive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    animation: float 20s linear infinite;
}

@keyframes float {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-100px);
    }
}

.archive-title {
    font-size: 3rem;
    font-weight: 900;
    color: white;
    margin: 0 0 15px;
    letter-spacing: -1px;
}

.archive-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 40px;
}

/* Filters */
.filters-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 100;
}

.filters-wrapper form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filters-grid {
    display: flex;
    gap: 12px;
    flex: 1;
}

.filter-item {
    flex: 1;
    min-width: 0;
}

.filter-label {
    display: none;
}

.filter-select,
.filter-input {
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
    width: 100%;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.filter-select option {
    background: white;
    color: var(--dark);
    padding: 10px;
    font-size: 0.95rem;
}

.filter-submit {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.filter-submit i {
    font-size: 0.9rem;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.view-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
    position: relative;
    z-index: 10;
}

.view-btn {
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
}

.view-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ================================
   UNIVERSITIES GRID
   ================================ */

.universities-wrapper {
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 20px;
}

.universities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* University Card */
.university-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.university-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.university-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.25);
}

.university-card:hover::before {
    opacity: 1;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.university-card:hover .card-image-wrapper img {
    transform: scale(1.1);
}

.card-country {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 10px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-title a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s;
}

.card-title a:hover {
    color: var(--primary);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: gap 0.3s;
    margin-top: auto;
}

.card-link:hover {
    gap: 12px;
}

/* ================================
   LIST VIEW
   ================================ */

.universities-grid.list-view {
    grid-template-columns: 1fr;
}

.universities-grid.list-view .university-card {
    display: flex;
    flex-direction: row;
}

.universities-grid.list-view .card-image-wrapper {
    width: 300px;
    height: auto;
}

.universities-grid.list-view .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ================================
   NO RESULTS
   ================================ */

.no-results {
    text-align: center;
    padding: 100px 20px;
}

.no-results-icon {
    font-size: 5rem;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.no-results h2 {
    font-size: 2rem;
    color: var(--dark);
    margin: 0 0 10px;
}

.no-results p {
    color: var(--gray);
    font-size: 1.1rem;
    margin: 0 0 30px;
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-reset:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */

@media (max-width: 768px) {
    .archive-header {
        padding: 60px 15px 40px;
    }

    .archive-title {
        font-size: 2rem;
    }

    .archive-subtitle {
        font-size: 1rem;
    }

    .filters-wrapper {
        padding: 15px;
        border-radius: 16px;
    }

    .filters-wrapper form {
        flex-direction: column;
        gap: 10px;
    }

    .filters-grid {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .filter-item {
        width: 100%;
    }

    .filter-select,
    .filter-input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .view-controls {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .view-btn {
        flex: 1;
        max-width: 120px;
    }

    .universities-wrapper {
        margin: 40px auto;
        padding: 0 15px;
    }

    .universities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .university-card {
        border-radius: 16px;
    }

    .university-card::before {
        border-radius: 16px;
    }

    .card-image-wrapper {
        height: 140px;
    }

    .card-country {
        bottom: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .card-body {
        padding: 14px;
    }

    .card-title {
        font-size: 0.85rem;
        margin: 0 0 8px;
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }

    .card-link {
        font-size: 0.8rem;
    }

    /* List view on mobile = grid view */
    .universities-grid.list-view {
        grid-template-columns: repeat(2, 1fr);
    }

    .universities-grid.list-view .university-card {
        flex-direction: column;
    }

    .universities-grid.list-view .card-image-wrapper {
        width: 100%;
        height: 140px;
    }
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.university-card {
    animation: fadeInUp 0.6s ease-out;
}

.university-card:nth-child(1) {
    animation-delay: 0.05s;
}

.university-card:nth-child(2) {
    animation-delay: 0.1s;
}

.university-card:nth-child(3) {
    animation-delay: 0.15s;
}

.university-card:nth-child(4) {
    animation-delay: 0.2s;
}

.university-card:nth-child(5) {
    animation-delay: 0.25s;
}

.university-card:nth-child(6) {
    animation-delay: 0.3s;
}