/**
 * Infinity Classes - Topper Wall / Hall of Fame Stylesheet
 * Exact match with Science Sangrah reference design
 */

.topper-wall-section {
    position: relative;
    width: 100%;
    min-height: 770px;
    background-color: #080706;
    /* Repeating Subtle Orange Plus (+) Pattern at 26px spacing */
    background-image: url("data:image/svg+xml,%3Csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 9V17M9 13H17' stroke='%23FF4B0B' stroke-opacity='0.13' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 26px 26px;
    padding: 55px 4.2% 45px;
    overflow: hidden;
}

/* Subtle Orange Ambient Glow behind cards */
.topper-wall-ambient-glow {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-width: 1100px;
    height: 380px;
    background: radial-gradient(ellipse at center, rgba(255, 75, 11, 0.16) 0%, rgba(255, 75, 11, 0.04) 50%, transparent 75%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 1;
}

.topper-wall-container {
    position: relative;
    max-width: 1480px;
    margin: 0 auto;
    z-index: 2;
}

/* Section Heading */
.topper-wall-header {
    text-align: center;
    max-width: 860px;
    margin: 0 auto;
}

.topper-wall-title {
    font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.3;
    color: #FFFFFF;
    margin: 0;
    letter-spacing: -0.5px;
}

.topper-wall-title-highlight {
    color: #FF4B0B;
}

.topper-wall-subtitle {
    font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif;
    font-size: 17px;
    color: #AEB4C0;
    line-height: 1.6;
    max-width: 650px;
    margin: 14px auto 0 auto;
    font-weight: 400;
}

/* 4-Card Grid on Desktop */
.topper-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-top: 68px;
    align-items: stretch;
}

/* Individual Topper Card */
.topper-card {
    position: relative;
    background-color: #FFFFFF;
    border-radius: 0 0 44px 0;
    overflow: visible;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 75, 11, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
    will-change: transform;
}

.topper-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 32px rgba(255, 75, 11, 0.22);
}

/* Circular Rank Badge */
.topper-rank-badge {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6A00 0%, #FF4500 50%, #D83A00 100%);
    border: 2.5px solid #FFFFFF;
    box-shadow: 0 8px 20px rgba(255, 69, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.topper-card:hover .topper-rank-badge {
    transform: scale(1.08) rotate(-4deg);
}

.topper-rank-number {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 0.95;
    margin-top: -2px;
}

.topper-rank-label {
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
    margin-top: 2px;
}

/* Portrait Image Container */
.topper-img-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border: 2px solid #FF4B0B;
    background-color: #111827;
}

.topper-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    -webkit-user-drag: none;
}

.topper-card:hover .topper-img {
    transform: scale(1.04);
}

/* Information Area */
.topper-info {
    padding: 22px 16px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    background-color: #FFFFFF;
    border-radius: 0 0 44px 0;
}

.topper-name {
    font-family: 'Poppins', sans-serif;
    font-size: 23px;
    font-weight: 900;
    color: #151515;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin: 0;
    white-space: nowrap;
}

.topper-district {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #788092;
    text-transform: uppercase;
    margin-top: 10px;
    line-height: 1;
}

/* Dark Score Badge */
.topper-score-badge {
    background-color: #171717;
    color: #FF6500;
    border: 1px solid #FF4B0B;
    border-radius: 7px;
    width: 110px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.topper-score-value {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.5px;
}

.topper-card:hover .topper-score-badge {
    transform: scale(1.05);
    background-color: #0E0E0E;
}

/* Bottom CTA Button */
.topper-cta-wrapper {
    text-align: center;
    margin-top: 48px;
}

.topper-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #FF4B0B;
    color: #FFFFFF;
    font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 800;
    width: 255px;
    height: 52px;
    border-radius: 40px;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(255, 75, 11, 0.35);
    transition: all 0.25s ease;
}

.topper-cta-btn:hover {
    background-color: #E03E00;
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(255, 75, 11, 0.5);
    color: #FFFFFF;
}

.topper-cta-btn i {
    font-size: 14px;
    transition: transform 0.25s ease;
}

.topper-cta-btn:hover i {
    transform: translateX(4px);
}

/* Animations */
.topper-reveal-init {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.topper-reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .topper-cards-grid {
        gap: 22px;
    }
    .topper-name {
        font-size: 20px;
    }
}

@media (max-width: 1024px) {
    .topper-wall-title {
        font-size: 38px;
    }
    .topper-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px 24px;
    }
}

@media (max-width: 640px) {
    .topper-wall-section {
        padding: 40px 14px 35px;
    }
    .topper-wall-title {
        font-size: 24px;
        line-height: 1.3;
    }
    .topper-wall-subtitle {
        font-size: 13px;
        margin-top: 8px;
    }
    .topper-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 12px;
        margin-top: 32px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    .topper-card {
        border-radius: 0 0 24px 0;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    }
    .topper-img-wrapper {
        border-bottom: 2px solid #FF4B0B;
    }
    .topper-info {
        padding: 10px 8px 14px 8px;
    }
    .topper-name {
        font-size: 13px;
        letter-spacing: -0.2px;
    }
    .topper-district {
        font-size: 9px;
        margin-top: 3px;
    }
    .topper-score-badge {
        width: 82px;
        height: 34px;
        margin: 10px auto 0 auto;
        border-radius: 6px;
    }
    .topper-score-value {
        font-size: 15px;
    }
    .topper-rank-badge {
        width: 44px;
        height: 44px;
        top: -8px;
        left: -8px;
        border-width: 2.5px;
    }
    .topper-rank-number {
        font-size: 17px;
    }
    .topper-rank-label {
        font-size: 7px;
    }
    .topper-cta-wrapper {
        margin-top: 30px;
    }
    .topper-cta-btn {
        width: 100%;
        max-width: 260px;
        height: 48px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topper-card,
    .topper-img,
    .topper-rank-badge,
    .topper-score-badge,
    .topper-cta-btn,
    .topper-reveal-init {
        transition: none !important;
        transform: none !important;
    }
}
