/* =========================================
   1. Global Variables & Reset
   ========================================= */
:root {
    /* Brand Colors */
    --primary-color: #0e46a3;
    --primary-dark: #0a337a;
    --primary-light: #eef4ff;
    --accent-color: #ff6b6b;

    /* Text Colors */
    --text-main: #2c3e50;
    --text-secondary: #596a7d;
    --text-muted: #95a5a6;

    /* Backgrounds */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;

    /* Spacing & Layout */
    --container-width: 1200px;
    --container-padding: 24px;
    --radius-sm: 8px;
    --radius-md: 16px;

    /* Shadows - softer & more modern */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 20px rgba(14, 70, 163, 0.08);
    --shadow-hover: 0 15px 30px rgba(14, 70, 163, 0.12);

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   2. Layout & Utilities
   ========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: 60px 0;
}

/* Section Title - Clean & Centered */
.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 60px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 20px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 4px;
}

/* =========================================
   3. Components
   ========================================= */

/* Logo */
.logo-container {
    padding: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.logo-container img {
    height: 60px;
    width: auto;
}

/* Banner */
.banner-container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.swiper {
    width: 100%;
    height: 480px;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Swiper Buttons - Simplified */
.swiper-button-prev,
.swiper-button-next {
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50%;
    color: var(--primary-color) !important;
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    transform: scale(1.1);
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 18px !important;
    font-weight: bold;
}

.swiper-pagination-bullet-active {
    background-color: var(--primary-color) !important;
    width: 24px !important;
    border-radius: 4px !important;
}

/* =========================================
   4. Feature Sections
   ========================================= */

/* Center Intro Text */
.center-intro .student-text {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 1.05em;
    line-height: 1.8;
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Course Grid - 4 Columns Desktop */
.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.course-item {
    background: #fff;
    padding: 30px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #f0f0f0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 110px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.course-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
    color: var(--primary-color);
}

/* Expert Cards - 5 Columns Desktop */
.expert-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.expert-item {
    background: #fff;
    padding: 30px 15px;
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
}

.expert-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.expert-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    /* Center horizontally */
    border: 4px solid var(--primary-light);
    display: block;
    /* Ensure it behaves as a block for margin: auto */
}

.expert-item h3 {
    color: var(--text-main);
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
}

.expert-item p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* Student Section */
.student-info {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    margin-bottom: 50px;
}

.student-text {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.student-text h3 {
    color: var(--primary-color);
    font-size: 26px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}

.student-text h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
}

.student-avatar {
    flex: 1;
    min-height: 450px;
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Training Institutions */
.training-institutions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.training-institutions img {
    border-radius: var(--radius-sm);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.training-institutions img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* Flow Steps */
.flow-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 60px 0;
    position: relative;
}

.flow-steps::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: #e1e4e8;
    z-index: 1;
}

.flow-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 100px;
    height: 100px;
    background: #fff;
    border: 2px solid var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.flow-step:hover .step-number {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0;
    text-align: center;
    font-size: 14px;
    margin-top: 80px;
}

/* Floating Button */
.enroll-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: var(--primary-color);
    color: #fff;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 10px 25px rgba(14, 70, 163, 0.3);
    z-index: 999;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.enroll-btn:hover {
    transform: translateY(-4px);
    background: var(--primary-dark);
    box-shadow: 0 15px 35px rgba(14, 70, 163, 0.4);
}

/* =========================================
   5. Modals - STRICT CENTERING
   ========================================= */
.modal,
.expert-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    /* High z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Dark overly */
    backdrop-filter: blur(8px);
    /* Modern blur */
    opacity: 0;
    transition: opacity 0.3s ease;

    /* CRITICAL: Flexbox Centering */
    align-items: center;
    justify-content: center;
}

.modal.show,
.expert-modal.show {
    opacity: 1;
    display: flex;
    /* Force Flex to center */
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 650px;
    border-radius: 20px;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
    from {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 36px;
    height: 36px;
    background: #f0f2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close:hover {
    background: #e1e4e8;
    color: var(--text-main);
}

.expert-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.expert-modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: block;
    object-fit: cover;
    border: 3px solid var(--primary-light);
}

.expert-modal-body {
    overflow-y: auto;
    padding-right: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.modal-footer {
    padding-top: 25px;
    margin-top: 25px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.enroll-now-btn {
    background: var(--primary-color);
    color: #fff;
    padding: 14px 45px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    display: inline-block;
    transition: var(--transition);
}

.enroll-now-btn:hover {
    background: var(--primary-dark);
}

/* =========================================
   6. Responsive Design
   ========================================= */

/* Tablet & Smaller Laptops */
@media (max-width: 1024px) {
    .expert-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cols on tablets */
    }

    .student-info {
        flex-direction: column;
    }

    .student-text {
        padding: 40px;
    }
}

/* Mobile Phones */
@media (max-width: 768px) {

    /* Layout */
    .container {
        padding: 0 20px;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 26px;
        margin-bottom: 40px;
    }

    /* Course Grid - 2 cols on mobile */
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .course-item {
        padding: 20px 10px;
        font-size: 14px;
        min-height: 90px;
    }

    /* Expert Grid - 2 cols on mobile */
    .expert-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .expert-item {
        padding: 20px 10px;
    }

    .expert-avatar {
        width: 100px;
        height: 100px;
    }

    /* Swiper */
    .swiper {
        height: 240px;
    }

    /* Flow Steps - Vertical */
    .flow-steps {
        flex-direction: column;
        gap: 40px;
        margin: 40px 0;
    }

    .flow-steps::before {
        width: 2px;
        height: 80%;
        top: 10%;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Floating Button */
    .enroll-btn {
        bottom: 25px;
        right: 25px;
        padding: 12px 28px;
        font-size: 14px;
    }

    /* Modals */
    .modal-content {
        padding: 25px;
        width: 90%;
    }
}

@media (max-width: 480px) {

    /* Even smaller screens */
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Keep 2 cols unless tiny */
    }

    .expert-grid {
        grid-template-columns: 1fr;
        /* 1 col for experts on tiny screens */
    }

    .swiper {
        height: 200px;
    }
}