/* =============================================
   AcadeMir School Selector Popup
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@400;500;600&display=swap');

/* ---- Overlay ---- */
#academir-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 30, 60, 0.82);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: overlayFadeIn 0.4s ease both;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Popup Card ---- */
#academir-popup {
    background: #ffffff;
    border-radius: 20px;
    max-width: 680px;
    width: 100%;
    padding: 48px 44px 44px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08);
    animation: popupSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.1s;
}

@keyframes popupSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Header ---- */
.popup-header {
    text-align: center;
    margin-bottom: 36px;
}

.popup-badge {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #1a6db5;
    background: #e8f2fb;
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 14px;
}

.popup-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 900;
    color: #0a1e3c;
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.popup-title span {
    color: #1a6db5;
}

.popup-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    color: #5a6a80;
    margin: 0;
    font-weight: 400;
}

/* ---- School Grid ---- */
.school-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 520px) {
    .school-grid {
        grid-template-columns: 1fr;
    }
    #academir-popup {
        padding: 32px 24px 28px;
    }
}

/* ---- School Card ---- */
.school-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: #f6f9fd;
    border: 2px solid #dde8f4;
    border-radius: 16px;
    padding: 28px 20px 22px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    outline: none;
    text-align: center;
    width: 100%;
}

.school-card:hover,
.school-card:focus-visible {
    border-color: #1a6db5;
    background: #eaf3fc;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26,109,181,0.18);
}

.school-card:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,109,181,0.14);
}

/* ---- Logo ---- */
.logo-wrap {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    flex-shrink: 0;
    transition: box-shadow 0.2s;
}

.school-card:hover .logo-wrap {
    box-shadow: 0 6px 22px rgba(26,109,181,0.22);
}

.logo-wrap img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    display: block;
}

/* ---- Label ---- */
.school-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.school-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #0a1e3c;
    line-height: 1.3;
}

.school-grades {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1a6db5;
    background: #ddeefa;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    letter-spacing: 0.04em;
}

/* ---- Arrow ---- */
.card-arrow {
    position: absolute;
    bottom: 14px;
    right: 16px;
    font-size: 16px;
    color: #1a6db5;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
}

.school-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Hide when dismissed ---- */
#academir-overlay.dismissed {
    animation: overlayFadeOut 0.35s ease forwards;
    pointer-events: none;
}

@keyframes overlayFadeOut {
    to { opacity: 0; }
}
