/**
 * State Courses Section - Option B Design (100px images)
 * Displays state-specific courses in blog posts and learn articles
 */

/* ========================================
   Main Section Container
   ======================================== */

.state-courses-section {
    margin: 40px 0 60px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffb606;
}

/* Section Header */
.state-courses-section .section-header {
    margin-bottom: 30px;
    position: relative;
}

.state-courses-section .section-header h2 {
    margin: 0 0 15px;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.state-courses-section .section-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.state-courses-section .section-intro p {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    flex: 1;
}

.state-courses-section .state-landing-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    color: #0073e6;
    text-decoration: none;
    border: 2px solid #0073e6;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.state-courses-section .state-landing-link:hover {
    background: #0073e6;
    color: #fff;
}

.state-courses-section .state-landing-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Course Cards Container (Option B)
   ======================================== */

.state-courses-section .courses-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual Course Card - Balanced Horizontal */
.state-course-balanced {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.state-course-balanced:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #ffb606;
}

/* Course Image - 100px (State Map) */
.state-course-balanced .course-image {
    flex: 0 0 100px;
}

.state-course-balanced .course-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* Course Information */
.state-course-balanced .course-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Course Title */
.state-course-balanced .course-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.state-course-balanced .course-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.state-course-balanced .course-title a:hover {
    color: #ffb606;
}

/* Course Badges */
.state-course-balanced .course-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.state-course-balanced .badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}

.state-course-balanced .badge.course-num {
    background: #e0e0e0;
    color: #555;
}

.state-course-balanced .badge.credits {
    background: #e3f2fd;
    color: #0073e6;
}

.state-course-balanced .badge.approved {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Course Buy Section */
.state-course-balanced .course-buy {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: auto;
}

/* Pricing */
.state-course-balanced .pricing {
    display: flex;
    align-items: center;
    gap: 10px;
}

.state-course-balanced .pricing .was {
    font-size: 16px;
    color: #dc3545;
    text-decoration: line-through;
}

.state-course-balanced .pricing .now {
    font-size: 22px;
    font-weight: 700;
    color: #0073e6;
}

/* Enroll Button */
.state-course-balanced .btn-enroll {
    padding: 10px 24px;
    background: #ffb606;
    color: #000;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.state-course-balanced .btn-enroll:hover {
    background: #ffc933;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 182, 6, 0.3);
}

/* ========================================
   View All Footer Button
   ======================================== */

.state-courses-section .view-all-footer {
    margin-top: 30px;
    text-align: center;
}

.state-courses-section .btn-view-all {
    display: inline-block;
    padding: 12px 32px;
    background: #0073e6;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.state-courses-section .btn-view-all:hover {
    background: #005bb5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 230, 0.3);
}

/* ========================================
   National States Carousel View (Swiper)
   ======================================== */

.states-carousel {
    position: relative;
    padding: 0 0 60px; /* Space for pagination */
    overflow: visible;
    /* Override Swiper CSS variables for yellow theme */
    --swiper-navigation-color: #ffb606;  /* Yellow arrow icons */
    --swiper-theme-color: #ffb606;
    --swiper-pagination-color: #ffb606;
}

.states-carousel .swiper-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0; /* Reset gap, we'll use margins instead */
}

.states-carousel .swiper-slide {
    height: auto;
    display: flex;
    box-sizing: border-box;
    align-items: stretch;
    padding: 10px; /* Add padding around each slide for spacing */
}

.state-card {
    padding: 24px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 180px; /* Ensure minimum consistent height */
}

.state-card-description {
    flex: 1; /* Push "Learn More" to bottom */
}

.state-card-link {
    margin-top: auto; /* Stick to bottom */
}

.state-card:hover {
    border-color: #ffb606;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* Swiper Navigation Buttons - Positioned in header like Latest Blogs */
.state-courses-section .carousel-navigation {
    position: absolute;
    top: 5px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.states-carousel .swiper-button-prev,
.states-carousel .swiper-button-next {
    width: 28px;
    height: 28px;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #ffb606 !important;
    transition: all 0.3s ease;
    position: static;
    margin: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.states-carousel .swiper-button-prev::after,
.states-carousel .swiper-button-next::after {
    font-size: 12px;
    font-weight: 900;
    color: #ffb606 !important;
}

/* Additional specificity for arrow color */
.state-courses-section .carousel-navigation .swiper-button-prev,
.state-courses-section .carousel-navigation .swiper-button-next {
    color: #ffb606 !important;
}

.states-carousel .swiper-button-prev:hover,
.states-carousel .swiper-button-next:hover {
    background: #ffb606 !important;
    background-color: #ffb606 !important;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(255, 182, 6, 0.5);
    cursor: pointer;
    transform: translateY(-1px);
}

.states-carousel .swiper-button-prev:hover::after,
.states-carousel .swiper-button-next:hover::after {
    color: #fff !important;
}

.states-carousel .swiper-button-prev.swiper-button-disabled,
.states-carousel .swiper-button-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Swiper Pagination */
.states-carousel .swiper-pagination {
    position: relative;
    margin-top: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.states-carousel .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ddd;
    opacity: 1;
    transition: all 0.3s ease;
    margin: 0 4px !important;
}

.states-carousel .swiper-pagination-bullet-active {
    background: #ffb606;
    width: 24px;
    border-radius: 5px;
}

.states-carousel .swiper-pagination-bullet:hover {
    background: #ffb606;
    cursor: pointer;
}

.state-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.state-card h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.course-count-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #0073e6;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    white-space: nowrap;
    align-self: flex-start;
}

.state-card-description {
    margin: 0 0 16px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    flex: 1;
}

.state-card-link {
    color: #0073e6;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.state-card:hover .state-card-link {
    gap: 10px;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .states-carousel {
        padding: 0 50px 50px;
    }

    .states-carousel .swiper-button-prev,
    .states-carousel .swiper-button-next {
        width: 40px;
        height: 40px;
    }

    .states-carousel .swiper-button-prev:after,
    .states-carousel .swiper-button-next:after {
        font-size: 18px;
    }

    .state-courses-section .section-intro {
        flex-direction: column;
        align-items: flex-start;
    }

    .state-courses-section .state-landing-link {
        align-self: flex-start;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .state-courses-section {
        padding: 20px;
        margin: 30px 0 40px;
    }

    .state-courses-section .section-header h2 {
        font-size: 24px;
    }

    .state-courses-section .section-intro p {
        font-size: 14px;
    }

    /* Stack course cards vertically */
    .state-course-balanced {
        flex-direction: column;
        padding: 16px;
    }

    .state-course-balanced .course-image {
        flex: 0 0 auto;
        align-self: center;
    }

    .state-course-balanced .course-buy {
        flex-direction: column;
        align-items: stretch;
    }

    .state-course-balanced .btn-enroll {
        text-align: center;
        width: 100%;
    }

    /* States carousel - mobile adjustments */
    .states-carousel {
        padding: 0 40px 40px;
    }

    .states-carousel .swiper-button-prev,
    .states-carousel .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .states-carousel .swiper-button-prev:after,
    .states-carousel .swiper-button-next:after {
        font-size: 16px;
    }

    .state-courses-section .btn-view-all {
        width: 100%;
        padding: 14px 24px;
    }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
    .state-courses-section {
        padding: 16px;
        margin: 20px 0 30px;
    }

    .state-courses-section .section-header h2 {
        font-size: 20px;
    }

    .state-course-balanced .course-title {
        font-size: 16px;
    }

    .state-course-balanced .pricing .now {
        font-size: 20px;
    }

    .state-card {
        padding: 16px;
    }

    .state-card h3 {
        font-size: 18px;
    }

    /* Very small screens - hide navigation, show pagination only */
    .states-carousel {
        padding: 0 10px 40px;
    }

    .states-carousel .swiper-button-prev,
    .states-carousel .swiper-button-next {
        display: none;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .state-courses-section {
        border-left: 2px solid #000;
        page-break-inside: avoid;
    }

    .state-course-balanced {
        page-break-inside: avoid;
    }

    .state-course-balanced .btn-enroll,
    .state-courses-section .btn-view-all,
    .state-courses-section .state-landing-link {
        border: 1px solid #000;
        background: transparent;
        color: #000;
    }
}
