/* --- Global --- */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --text-color: #374151;
    --heading-color: #111827;
    --font-family: 'Inter', sans-serif;
    --font-family-poppins: 'Poppins', sans-serif;
}

body .popular-exams-section {
    font-family: var(--font-family);
    color: var(--text-color);
}

.popular-exams-section h1,
.popular-exams-section h2,
.popular-exams-section h3,
.popular-exams-section h4,
.popular-exams-section h5,
.popular-exams-section h6 {
    color: var(--heading-color);
    font-family: var(--font-family-poppins);
}

.popular-exams-section a {
    text-decoration: none;
}


/* --- Popular Exams --- */
.feature-icon-wrapper {
    width: 60px;
    height: 60px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #e0f2fe; /* light blue */
    color: var(--primary-color);
}

.exam-tabs-wrapper {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.exam-tabs-container {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem; /* 12px */
    padding: 0.25rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.exam-tabs-container::-webkit-scrollbar {
    display: none;
}

.exam-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    cursor: pointer;
}

.exam-tab .exam-tab-count {
    background-color: #e5e7eb;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    transition: all 0.2s ease-in-out;
}

.exam-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.exam-tab.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.exam-tab.active .exam-tab-count {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

.exam-sub-tabs-container {
    padding-bottom: 1rem;
}

.exam-sub-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    background-color: #f3f4f6;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.exam-sub-tab .exam-sub-tab-count {
    background-color: #d1d5db;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    transition: all 0.2s ease-in-out;
}

.exam-sub-tab:hover {
    background-color: #e5e7eb;
}

.exam-sub-tab.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.exam-sub-tab.active .exam-sub-tab-count {
    background-color: #ffffff;
    color: var(--primary-color);
}

.exam-item-card {
    display: none;
}

.exam-item-card.visible {
    display: block;
    animation: fadeIn 0.5s;
}

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


.exam-tab-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease-in-out;
}

.exam-tab-arrow:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.exam-tab-arrow.prev-tab-btn {
    left: -16px;
}

.exam-tab-arrow.next-tab-btn {
    right: -16px;
}

.exam-tab-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (min-width: 768px) {
    .exam-tab-arrow {
        display: flex;
    }
}

/* --- Product Card UI Enhancements --- */

.enroll-now-btn,
.enroll-now-btn:focus,
.enroll-now-btn:active {
    background: linear-gradient(90deg, #32BDEE 0%, #C81786 100%) !important;
    color: #ffffff !important;
    transition: background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.enroll-now-btn:hover {
    background: #C81786 !important;
    box-shadow: 0 4px 14px 0 rgba(200, 23, 134, 0.4) !important;
    color: #ffffff !important;
}

.exam-item-card .rating-stars {
    display: flex;
    align-items: center;
}

.rating-stars .star-rating {
    font-size: 1em;
    color: #f59e0b;
}

/* --- Coupon Card Styles --- */
.coupon-card {
    color: white;
    padding: 24px;
    border-radius: 15px;
    text-align: center;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    font-family: var(--font-family-poppins);
    transition: all 0.3s ease;
}
.coupon-card.hidden {
    display: none;
}

.coupon-gradient-purple { background: linear-gradient(135deg, #a777e3, #6e8efb); }
.coupon-gradient-green { background: linear-gradient(135deg, #4ade80, #16a34a); }
.coupon-gradient-orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.coupon-gradient-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.coupon-gradient-red { background: linear-gradient(135deg, #f87171, #ef4444); }
.coupon-gradient-yellow { background: linear-gradient(135deg, #facc15, #eab308); }


.coupon-card::before,
.coupon-card::after {
    content: '';
    position: absolute;
    background-color: #f0f2f5;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.coupon-card::before {
    left: -15px;
}

.coupon-card::after {
    right: -15px;
}

.coupon-badge {
    position: absolute;
    top: 11px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.coupon-badge.latest {
    background-color: #22c55e;
}
.coupon-badge.expired {
    background-color: #6b7280;
}

.coupon-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    color: white !important;
}

.coupon-title span {
    font-size: 1rem;
    font-weight: 400;
    display: block;
}

.coupon-description {
    margin: 12px 0 20px;
    font-size: 0.8rem;
    opacity: 0.9;
    font-family: var(--font-family);
}

.coupon-code-container {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px dashed white;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.coupon-code {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 2px;
    user-select: all;
}

.copy-btn {
    background-color: #ffffff;
    color: #6e8efb;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-family: var(--font-family-poppins);
}

.copy-btn:hover {
    background-color: #f0f2f5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.copy-btn.copied {
    background-color: #28a745;
    color: white;
}

/* --- NEW: Mobile Coupon Card Horizontal Scroll --- */
@media (max-width: 1023px) {
    #coupon-list-container {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        padding-bottom: 1rem;
        /* Enable snap scrolling */
        scroll-snap-type: x mandatory;
        /* Hide scrollbar */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    #coupon-list-container::-webkit-scrollbar {
        display: none;
    }

    /* Override the Tailwind 'space-y' utility on mobile */
    #coupon-list-container > * {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .coupon-card {
        width: 85%; /* Main card takes up 85% of width */
        flex-shrink: 0; /* Prevent cards from shrinking */
        scroll-snap-align: start; /* Each card will snap to the start */
    }
}

/* --- Pagination Styles --- */
.csp-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.csp-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.csp-page-btn:hover:not(:disabled) {
    border-color: #C81786;
    color: #C81786;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.csp-page-btn.active {
    background: linear-gradient(90deg, #32BDEE 0%, #C81786 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(200, 23, 134, 0.3) !important;
}

.csp-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f3f4f6;
    color: #9ca3af;
}

.csp-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #9ca3af;
    font-size: 0.95rem;
}

/* Paginated Hidden state */
.exam-item-card.visible.paginated-hidden {
    display: none !important;
}