/* ===== PREMIUM PAGE - SYNCED WITH LIBRARY HERO STYLE ===== */

.premium-title-section {
    background: #fff;
    padding: 4rem 0 1rem;
    margin-top: 160px;
    /* Space for fixed header */
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.premium-header-row {
    position: relative;
    /* Base for search positioning */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 3rem;
}

/* Expanding Search - Extreme Right */
.premium-search-wrapper {
    position: absolute;
    right: 0;
    margin-top: -105px;
    /* Shifted upward by 105px total */
    display: flex;
    align-items: center;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50px;
    padding: 2px;
}

.premium-search-wrapper.expanded {
    background: #f8f9fa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--primary-yellow);
    padding-right: 15px;
}

.premium-search-input {
    width: 0;
    opacity: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    font-size: 0.95rem;
    transition: all 0.4s ease;
    font-family: var(--font-body);
}

.premium-search-wrapper.expanded .premium-search-input {
    width: 250px;
    opacity: 1;
    padding: 0 1rem;
    height: 32px;
    /* Explicit height to match slim profile */
    line-height: 32px;
}

.premium-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 6px;
    /* Reduced further for a slim 10% height reduction */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.premium-search-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.premium-search-wrapper.expanded .premium-search-btn {
    color: var(--primary-yellow);
}

/* Centered Title Content */
.premium-title-content {
    flex: 1;
    max-width: 900px;
    margin-top: 5px;
    /* Shifted downward by 5px */
}

.premium-page-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.premium-page-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    font-style: italic;
    margin: 0;
}

/* Responsive Design (Synced with Library) */
@media (max-width: 1200px) {
    .container-wide {
        max-width: 100%;
        padding: 0 2rem;
    }

    .premium-page-title {
        font-size: 3rem;
    }
}

@media (max-width: 968px) {
    .premium-title-section {
        padding: 3rem 0 2.5rem;
        margin-top: 155px;
    }

    .premium-page-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .premium-header-row {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .premium-title-content {
        width: 100%;
    }

    .premium-page-title {
        font-size: 2.25rem;
    }

    .premium-page-subtitle {
        font-size: 1.05rem;
    }

    .premium-title-section {
        padding: 2.5rem 0 2rem;
        margin-top: 150px;
    }

    .premium-search-wrapper {
        transform: translateY(-80%);
    }

    .premium-grid-section {
        transform: translateY(-1%);
    }
}

@media (max-width: 480px) {
    .premium-title-section {
        padding: 2rem 0 1.5rem;
        margin-top: 145px;
    }

    .premium-page-title {
        font-size: 2rem;
    }

    .premium-page-subtitle {
        font-size: 1rem;
    }

    .container-wide {
        padding: 0 1rem;
    }
}

/* ===== PREMIUM SUBJECTS GRID SECTION ===== */
.premium-grid-section {
    background: #fdfdfd;
    /* Light neutral background */
    padding: 2.5rem 0 6rem;
    min-height: 600px;
    flex-grow: 1;
}

.premium-subjects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(2rem + 10px);
    margin: 0 auto;
    max-width: 1012px;
    /* Increased from 920px (10% increase) */
}

/* Subject Card - Portrait Format */
.premium-subject-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.placard-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 0.8;
    /* Vertical oriented portrait format */
    overflow: hidden;
}

.placard-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures image fills portrait well */
    transition: transform 0.6s ease;
}

/* Always-visible Placard Info - Split Layout */
.placard-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 45% 1rem 0;
    /* Bottom padding handled by label bar */
    text-align: center;
    z-index: 1;
    transition: all 0.4s ease;
    pointer-events: none;
}

.subject-title-static {
    color: var(--primary-yellow);
    /* Brand Yellow */
    margin: 0;
    font-size: 1.55rem;
    /* Reduced size by ~7px */
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* restored some spacing */
    line-height: 1.1;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

.syllabus-label {
    color: #fff;
    /* White */
    padding: 0 0 1.5rem;
    /* Space from bottom edge */
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 3px;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    /* Ensures contrast without the bar */
}

/* Hide info on hover to show buy options */
.premium-subject-card:hover .placard-info {
    opacity: 0;
    transform: translateY(-5px);
}

/* Hover Overlay State */
.premium-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* 40% opacity dark overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 1.5rem;
    /* Slightly reduced padding */
    z-index: 2;
}

/* Content inside hover overlay */
.access-label {
    color: #fff;
    font-size: calc(1rem + 2px);
    font-weight: 600;
    letter-spacing: 3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    text-align: center;
    margin-top: calc(26% + 5px);
    margin-bottom: 0.4rem;
    transform: translateY(15px);
    transition: all 0.4s ease 0.1s;
}

.premium-price {
    color: #fff;
    font-size: 2rem;
    /* Scaled up for 10% larger cards */
    font-weight: 700;
    margin-bottom: 1.2rem;
    font-family: var(--font-heading);
    transform: translateY(15px);
    transition: all 0.4s ease 0.15s;
}

.premium-buy-btn {
    background: var(--primary-yellow);
    /* Brand Yellow */
    color: #333;
    border: none;
    padding: 0.7rem 1.2rem;
    /* Adjusted padding to fit text */
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    /* Scaled up */
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    /* Force single line */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
    transform: translateY(15px);
    transition: all 0.4s ease 0.2s;
}

.premium-buy-btn:hover {
    background: #FFCA00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 217, 61, 0.4);
}

/* Card Hover Interactions */
.premium-subject-card:hover {
    transform: translateY(-8px) scale(1.03);
    /* Subtle scale-up effect */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.premium-subject-card:hover .placard-wrapper img {
    transform: scale(1.1);
}

.premium-subject-card:hover .premium-hover-overlay {
    opacity: 1;
    visibility: visible;
}

.premium-subject-card:hover .access-label,
.premium-subject-card:hover .premium-price,
.premium-subject-card:hover .premium-buy-btn {
    transform: translateY(0);
    /* Smooth upward motion */
}

/* Responsive Grid Adjustments */
@media (max-width: 800px) {
    .premium-subjects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        max-width: 600px;
    }
}

@media (max-width: 550px) {
    .premium-subjects-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: 1rem;
        margin: 0 auto;
    }

    .premium-grid-section {
        padding: 2rem 0;
    }

    /* Scaling Typography for Mobile 2-Column Cards */
    .subject-title-static {
        font-size: 1.1rem;
    }

    .syllabus-label {
        font-size: 0.75rem;
        letter-spacing: 1.5px;
    }

    .access-label {
        font-size: 0.8rem;
        letter-spacing: 1.5px;
    }

    .premium-price {
        font-size: 1.35rem;
        margin-bottom: 0.8rem;
    }

    .premium-buy-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.7rem;
    }
}

.premium-price.free-text {
    color: #ff4d4d !important;
    text-shadow: 0 2px 10px rgba(255, 77, 77, 0.4);
    letter-spacing: 2px;
}

.premium-price.free-text:hover {
    color: #ff6666 !important;
    transform: translateY(13px);
}