/* Ecommerce/public/assets/css/page-index.css */

/* (ส่วนของ .error-box และ .profile-summary-v8 (สำหรับคน Login แล้ว) ยังคงอยู่เหมือนเดิม) */
/* (GEMINI: เรายังเก็บ CSS ของ .profile-summary-v8 และ .dash-course-card ไว้
   เพราะ Modal ใหม่ของเรายังคงใช้สไตล์ .dash-course-card และ .large-grid) */
.error-box {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    margin: 15px 24px; 
    border-radius: 8px;
    max-width: 1400px; 
    margin-left: auto;
    margin-right: auto;
}

/* * =======================================
 * (*** V10: CSS สำหรับ HYBRID SUMMARY (เมื่อ Login แล้ว) ***)
 * =======================================
 */
.profile-summary-v8 {
    background-color: #f8f9fa; 
    padding: 40px 0;
    border-bottom: 1px solid #dee2e6;
}

:root {
    --dash-font: 'DB Heavent Cond', 'Sarabun', sans-serif;
    --dash-bg-panel: #ffffff; 
    --dash-border: #dee2e6; 
    --dash-text-primary: #212529; 
    --dash-text-secondary: #6c757d; 
    --dash-green: #3DD59B;
}

/* (A) Panel ต้อนรับ */
.dash-panel {
    background: var(--dash-bg-panel); 
    border: 1px solid var(--dash-border); 
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    margin-bottom: 25px;
    font-family: var(--dash-font);
    font-size: 1.3rem;
}
.profile-summary-v8 .course-container .dash-panel:last-child {
    margin-bottom: 0;
}

.dash-panel .panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--dash-border); 
}
.dash-panel .panel-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--dash-text-primary); 
}
.dash-panel .panel-body {
    padding: 20px;
}
#welcome-panel {
    background: #3c6fcf; 
    color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
}
#welcome-panel .panel-body {
    padding: 25px 30px;
}
#welcome-panel h1 { 
    font-size: 2.2rem; 
    color: #FFFFFF; 
    font-weight: 700;
    margin: 0 0 5px 0;
}
#welcome-panel p { 
    font-size: 1.3rem; 
    color: rgba(255,255,255,0.8); 
    margin: 0;
}

.welcome-actions {
    flex-shrink: 0;
    margin-left: 20px;
    padding: 25px 30px 25px 0; 
    text-align: right;
}
.welcome-action-text {
    font-size: 1.1rem; 
    color: rgba(255,255,255,0.7);
    margin: 0 0 8px 0; 
    font-family: var(--dash-font);
}

#welcome-panel .btn-primary {
    background-color: transparent;
    color: #FFFFFF;
    border: 2px solid #FFFFFF; 
    padding: 8px 18px; 
    font-weight: 600; 
}
#welcome-panel .btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.15); 
    border-color: #FFFFFF;
    color: #FFFFFF;
}


/* (B) Panel เรียนต่อ (ส่วนนี้เหมือนเดิม) */
/* (GEMINI: เรายังต้องใช้สไตล์เหล่านี้ใน Modal) */
#continue-learning-panel {
}
.dash-course-grid.large-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.dash-course-card {
    display: block;
    background: #ffffff; 
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--dash-border); 
    color: var(--dash-text-primary);
}
.dash-course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    color: var(--dash-text-primary);
}
.dash-course-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid var(--dash-border); 
}
.dash-course-card h5 {
    font-size: 1.3rem;
    padding: 10px 15px 5px 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    margin: 0;
}
.dash-progress-bar {
    width: calc(100% - 30px); 
    height: 8px;
    background-color: #e9ecef; 
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 15px 15px 15px;
}
.dash-progress-bar .progress-fill {
    height: 100%;
    background-color: #3c6fcf; 
    border-radius: 4px;
    transition: width 0.5s ease;
}
.dash-progress-bar .progress-fill.completed {
    background-color: var(--dash-green); 
}
.dash-placeholder {
    font-size: 1.2rem;
    color: var(--dash-text-secondary); 
    text-align: center;
    padding: 20px;
}

/* (*** V13: CSS .dash-lesson-subtitle ถูกลบออกไปแล้ว ***) */


/* (V9: Responsive) */
@media (max-width: 768px) {
    #welcome-panel {
        flex-direction: column;
        align-items: stretch; 
    }
    #welcome-panel .panel-body {
        padding: 25px 30px 15px 30px; 
    }
    .welcome-actions {
        padding: 0px 30px 25px 30px; 
        margin-left: 0;
        text-align: left; 
    }
    .welcome-action-text {
        text-align: left;
    }
}
@media (max-width: 576px) {
    .dash-course-grid.large-grid {
        grid-template-columns: 1fr; 
    }
}


/* =======================================
 * (*** V_NEW_HERO (V19): CSS สำหรับ NEW HERO SECTION ***)
 * (ปรับสี Gradient ม่วง-ชมพู-ส้ม ให้สดใส)
 * =======================================
 */

/* (V19: ตัวแปรสีใหม่ที่สดใส) */
:root {
    --hero-purple: #7E22CE; /* ม่วงสด */
    --hero-pink: #E52E71;   /* ชมพู/แดงสด */
    --hero-orange: #FF6B00;  /* ส้มสด */
    --hero-blue-bright: #007BFF; /* น้ำเงินสด (สำหรับ Tag) */

    --hero-bg-white: #ffffff; /* ขาว */
    --hero-text-dark: #212529; /* สีข้อความเข้ม */
    --hero-text-gray: #6c757d; /* สีข้อความรอง */
    --hero-border-light: #e2e8f0; /* สีเส้นขอบอ่อน */
    --hero-shadow-light: rgba(0,0,0,0.05); /* เงาอ่อน */
}

.new-hero-section {
    background: var(--hero-bg-white); /* (V17: เปลี่ยนเป็นสีขาว) */
    padding: 50px 0; /* เพิ่ม padding ด้านบนและล่าง */
    border-bottom: 1px solid var(--hero-border-light);
    overflow: hidden; /* ป้องกันไม่ให้ blob ล้น */
    position: relative;
}

.new-hero-container {
    max-width: 1800px; /* ขยายความกว้างให้เต็มขอบจอมากขึ้น */
    margin: 0 auto;
    padding: 0 40px; /* เพิ่ม padding ซ้ายขวา */
    display: flex;
    align-items: center;
    gap: 60px; /* เพิ่มช่องว่างระหว่าง Content กับ Visual */
}

/* (A) เนื้อหาด้านซ้าย */
.new-hero-content {
    flex: 1;
    min-width: 0;
    z-index: 2; /* ให้อยู่เหนือ Gradient */
}

/* --- (A.1) Gradient Text สำหรับ H1 --- */
.new-hero-content h1.gradient-text {
    font-size: 4.0rem; /* ขนาดใหญ่ขึ้น */
    font-weight: 800;
    line-height: 1.1; /* ปรับ line-height */
    margin-bottom: 20px;
    
    /* --- (V19: เปลี่ยนเป็นสี ม่วง -> ชมพู -> ส้ม) --- */
    background: linear-gradient(90deg, #1d4ed8 0% 0%, var(--hero-pink) 70%, var(--hero-orange) 100%);
    -webkit-background-clip: text; /* ทำให้ gradient ปรากฏเฉพาะในตัวอักษร */
    -webkit-text-fill-color: transparent; /* ทำให้ตัวอักษรโปร่งใส */
    background-clip: text; /* สำหรับมาตรฐานอื่นๆ */
    color: transparent; /* สำหรับมาตรฐานอื่นๆ */
}

.hero-description {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--hero-text-gray);
    margin-bottom: 40px; /* เพิ่มระยะห่างกับ Search Bar */
    line-height: 1.4;
}

/* --- (A.2) Search Form (V2: ตามรูปใหม่) --- */

.hero-search-wrapper {
    max-width: 680px; /* ขยายความกว้างของ Search Wrapper */
    margin-bottom: 40px; /* ระยะห่างกับ Section ถัดไป */
    position: relative; /* สำหรับตำแหน่งของ Tabs */
    z-index: 3; /* ให้ Search Wrapper อยู่บนสุด */
}

.hero-search-tabs {
    display: flex;
    margin-bottom: -1px; /* ให้ปุ่มทับเส้นขอบของ form ด้านล่างเล็กน้อย */
    position: relative;
    z-index: 2; /* ให้อยู่บน search form */
    left: 10px; /* ขยับแท็บให้ดูเหมือนเริ่มต้นจากใน form */
}

.search-tab-button {
    padding: 12px 35px;
    font-size: 1.8rem;
    font-weight: 600;
    border: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.08); /* เงาด้านบน */
    color: var(--hero-text-dark); /* สีข้อความปกติ */
    background-color: #f0f4f8; /* สีพื้นหลังเมื่อไม่ active */
    border-bottom: 1px solid transparent; /* เส้นกั้นด้านล่าง */
}

.search-tab-button.active {
    /* --- (V19: เปลี่ยนเป็นสี ม่วง -> ชมพู) --- */
    background: linear-gradient(90deg, #1d4ed8 0%, var(--hero-pink) 100%);
    color: #fff;
    /* --- (V19: เปลี่ยน Box Shadow เป็น Gradient 'Glow') --- */
    box-shadow: 0 5px 25px rgba(126, 34, 206, 0.4), /* เงาสีม่วง */
                inset 0 3px 5px rgba(255,255,255,0.2); 
    
    transition: all 0.3s ease, box-shadow 0.4s ease-out;
}
.search-tab-button.active:hover {
    box-shadow: 0 8px 30px rgba(126, 34, 206, 0.5), /* เงาสีม่วงเข้มขึ้น */
                inset 0 3px 5px rgba(255,255,255,0.2);
    transform: translateY(-2px); /* ยกขึ้นเล็กน้อย */
}


.search-tab-button:not(.active):hover {
    background-color: #e2e8f0; /* สีอ่อนลงเมื่อ hover */
    color: var(--hero-text-dark);
}

.search-tab-button i {
    margin-right: 8px;
}


/* --- Search Form V2 (กล่องหลัก) --- */
.hero-search-form-v2 {
    background-color: var(--hero-bg-white);
    border: 1px solid var(--hero-border-light);
    border-radius: 15px; /* โค้งมนมากขึ้น */
    padding: 30px; /* เพิ่ม padding ภายใน */
    box-shadow: 0 10px 30px rgba(47, 84, 248, 0.664); /* เงาที่ดูนุ่มนวลและเด่นชัดขึ้น */
    position: relative;
    z-index: 1; /* ให้อยู่ใต้ tabs */
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--hero-border-light);
    border-radius: 10px; /* โค้งมนของ input */
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #f7fafd; /* สีพื้นหลังของ input field */
}

.hero-search-input-v2 {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 20px;
    font-size: 1.1rem;
    color: var(--hero-text-dark);
    background: transparent;
}
.hero-search-input-v2::placeholder {
    color: var(--hero-text-gray);
    opacity: 0.7;
}

.hero-search-submit-button {
    background-color: transparent; /* ไม่มีพื้นหลัง */
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--hero-text-gray);
    transition: all 0.3s ease; /* (V19: transition ทั้งหมด) */
    border-radius: 10px; /* (V18: เพิ่ม radius ให้กับปุ่มนี้) */
}
/* --- (V19: เพิ่ม Gradient Background และ 'Glow' Shadow เมื่อ Hover) --- */
.hero-search-submit-button:hover {
    color: #fff; /* เปลี่ยนสี icon เป็นสีขาวเมื่อ hover */
    background: linear-gradient(90deg, var(--hero-purple) 0%, var(--hero-pink) 100%); /* Gradient ม่วง-ชมพู */
    box-shadow: 0 5px 20px rgba(126, 34, 206, 0.4); /* เงาสีม่วง */
    transform: translateY(-2px) scale(1.05); /* ยกขึ้นและขยายเล็กน้อย */
}


/* --- Search Tags V2 --- */
.search-tags-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.search-tag-item-v2 {
   background: linear-gradient(90deg, #1d4fd8ad 0%, #8d24eead 100%);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid var(--hero-border-light);
    border-radius: 25px; /* โค้งมนมากขึ้น */
    padding: 10px 22px;
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* เงาอ่อนๆ */
}
.search-tag-item-v2:hover {
    background-color: var(--hero-blue-bright); /* (V19: เปลี่ยนเป็นสีน้ำเงินสด) */
    border-color: var(--hero-blue-bright);
    color: #fff; /* ข้อความสีขาว */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3); /* (V19: เงาสีน้ำเงิน) */
}


/* (B) Visual Image Block ด้านขวา (V17) */
.new-hero-visual {
    flex: 1;
    max-width: 42%; /* ปรับขนาดบล็อกรูปภาพ */
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-image-v17 {
    width: 100%;
    max-width: 550px; /* กำหนดขนาดใหญ่สุดของรูป */
    height: auto;
    object-fit: contain;
    border-radius: 15px; /* ทำให้รูปโค้งมนเล็กน้อย (เผื่ออยากใช้) */
}


/* --- Responsive Adjustments (V17) --- */
@media (max-width: 992px) {
    .new-hero-section {
        padding: 60px 0;
    }
    .new-hero-container {
        flex-direction: column;
        text-align: center;
        padding: 0 24px;
        gap: 30px;
    }
    .new-hero-content {
        order: 2; /* เนื้อหาอยู่ล่าง */
    }
    .new-hero-content h1.gradient-text {
        font-size: 3.5rem; /* ลดขนาด H1 */
    }
    .hero-description {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    .hero-search-wrapper {
        margin-bottom: 30px;
        max-width: 100%; /* เต็มความกว้างในมือถือ */
    }
    .hero-search-tabs {
        justify-content: center; /* จัดกลางแท็บ */
        left: 0; /* เลิกขยับแท็บ */
        width: 100%; /* ให้แท็บเต็มความกว้าง */
        border-radius: 0; /* ไม่มี radius ด้านบน */
    }
    .search-tab-button {
        flex: 1; /* แบ่งพื้นที่เท่ากัน */
        border-top-left-radius: 0; /* ลบ radius ที่ไม่จำเป็น */
        border-top-right-radius: 0;
        padding: 10px 15px;
        font-size: 1rem;
    }
    .hero-search-form-v2 {
        padding: 15px; /* ลด padding */
        border-radius: 0 0 15px 15px; /* โค้งมนเฉพาะด้านล่าง */
    }
    .hero-search-input-v2 {
        padding: 12px 15px;
        font-size: 1rem;
    }
    .hero-search-submit-button {
        padding: 12px 15px;
        font-size: 1.1rem;
    }
    /* (V19: Responsive hover effect for search button on mobile) */
    .hero-search-submit-button:hover {
        transform: none; /* (ไม่ต้องยกขึ้นในมือถือ) */
    }
    
    .search-tags-v2 {
        justify-content: center;
        gap: 8px;
    }
    .search-tag-item-v2 {
        padding: 8px 18px;
        font-size: 1.5rem;
    }

    /* (V17: Responsive FOr Image Block) */
    .new-hero-visual {
        order: 1; /* Visual อยู่บน */
        max-width: 100%;
        height: auto; /* ความสูงอัตโนมัติ */
        margin-bottom: 20px;
    }
    .hero-image-v17 {
        max-width: 350px; /* ลดขนาดรูปในมือถือ */
    }
}
@media (max-width: 576px) {
    .search-tab-button {
        font-size: 1.5rem;
        padding: 8px 10px;
    }
}

/* ===================================================== */
/* --- (*** (V-GEMINI-FIX) ลบ .homepage-grid-5 ออก ***) --- */
/* ===================================================== */
/* โค้ด .homepage-grid-5 ถูกลบออกจากที่นี่
    (The .homepage-grid-5 code was removed from here)
    
    เนื่องจากฟังก์ชัน `initializeHomepageCarousels` ใน script.js
    (Because the `initializeHomepageCarousels` function in script.js)
    
    จะเป็นตัวจัดการการแสดงผล 5 คอลัมน์บน Desktop ผ่าน .owl-carousel แทน
    (will now handle the 5-column display on desktop via .owl-carousel instead)
*/
/* ======================================= */
/* --- (V-Login) ซ่อน Hero เมื่อล็อกอิน --- */
/* ======================================= */

body.user-logged-in .hero-section {
    display: none;
}

/* ===================================================== */
/* --- (*** V3: Homepage Course Carousel (Mobile) ***) --- */
/* ===================================================== */

/* (*** GEMINI: นี่คือโค้ดส่วนสไลด์มือถือที่ผมจะไม่แตะต้องครับ ***) */
@media (max-width: 768px) {
    
    /* (1) เมื่อ JS เพิ่มคลาส .owl-carousel เข้ามา: */
    /* - ให้ override display: grid จาก styles.css */
    /* - ลบ max-width ออก ให้มันสไลด์ได้เต็มจอ */
    .course-section .course-grid.homepage-carousel-grid.owl-carousel {
        display: block; /* (สำคัญ!) */
        grid-template-columns: unset;
        max-width: none;
        margin: 0;
    }

    /* (2) กำหนดความกว้างของ Card แต่ละใบใน Carousel */
    /* (เราใช้ autoWidth: true ใน JS) */
    .homepage-carousel-grid.owl-carousel .owl-item {
        /* ตั้งค่าความกว้างของ Card ให้เหมาะสม
           เช่น 280px จะทำให้เห็น 1 การ์ดเต็ม และเห็นการ์ดถัดไป "โผล่" มานิดหน่อย
        */
        width: 280px !important; 
    }

    /* (3) ทำให้ Card ยืดเต็มความสูงของแถว */
    .homepage-carousel-grid.owl-carousel .course-card-wrapper {
         height: 100%;
         display: flex;
    }
    .homepage-carousel-grid.owl-carousel .course-card {
         width: 100%;
    }

    /* (4) แสดง "จุด" (Dots) ใต้ Carousel */
    .homepage-carousel-grid.owl-carousel .owl-dots {
        display: block;
        text-align: center;
        margin-top: 20px;
    }

    /* (5) ซ่อน "ลูกศร" (Nav) (ถ้ามี) */
    .homepage-carousel-grid.owl-carousel .owl-nav {
        display: none;
    }
}
/* (*** GEMINI: จบส่วนสไลด์มือถือ ***) */


/* ========================================================
 * (*** GEMINI-MOD-V7: START - Tab State & Stronger Animation ***)
 * (*** แทนที่โค้ด GEMINI-MOD-V6 เดิม ***)
 * ========================================================
 */

/* 1. กำหนด Keyframes สำหรับอนิเมชัน "แสงเรืองรอง" (แบบที่แรงขึ้น)
 */
@keyframes pulse-gradient-shadow-strong {
    0% {
        /* (เงาสีม่วง เริ่มต้น) */
        box-shadow: 0 5px 25px rgba(126, 34, 206, 0.4), 
                    inset 0 3px 5px rgba(255,255,255,0.2);
    }
    50% {
        /* (เงาสีชมพูที่ "แรงขึ้น" และ "สว่างขึ้น" มากๆ) */
        box-shadow: 0 10px 60px 15px rgba(229, 46, 113, 0.7), 
                    inset 0 3px 5px rgba(255,255,255,0.3);
    }
    100% {
         /* (เงาสีม่วง กลับมาที่เดิม) */
        box-shadow: 0 5px 25px rgba(126, 34, 206, 0.4), 
                    inset 0 3px 5px rgba(255,255,255,0.2);
    }
}

/* 2. (GEMINI: แก้ไข!) กำหนดสไตล์ปุ่ม "เรียนต่อฯ" (ตอนที่ "ไม่" Active)
 * ให้เหมือนปุ่มค้นหาที่ "ไม่" Active (สีเทาอ่อน)
 */
.search-tab-button.search-tab-resume:not(.active) {
    background-color: #f0f4f8; /* (สีเทาอ่อน เหมือนปุ่มค้นหา) */
    color: var(--hero-text-dark); /* (สีตัวอักษรเข้ม) */
    box-shadow: 0 -3px 10px rgba(0,0,0,0.08); /* (เงาเริ่มต้น) */
}
.search-tab-button.search-tab-resume:not(.active):hover {
    background-color: #e2e8f0; /* (สีเทาเข้มขึ้น เหมือนปุ่มค้นหา) */
    color: var(--hero-text-dark);
    transform: translateY(-2px);
}


/* 3. (GEMINI: แก้ไข!) กำหนดสไตล์ปุ่ม "เรียนต่อฯ" (ตอนที่ "Active" เท่านั้น)
 * ให้มี Gradient และ Animation
 */
.search-tab-button.search-tab-resume.active {
    /* (ย้าย Gradient มาไว้ที่นี่) */
    background: linear-gradient(90deg, #1d4ed8 0%, var(--hero-pink) 100%);
    color: #fff;
    
    /* (ย้าย Shadow เริ่มต้นมาไว้ที่นี่) */
    box-shadow: 0 5px 25px rgba(126, 34, 206, 0.4),
                inset 0 3px 5px rgba(255,255,255,0.2);
    
    /* (สั่งให้เล่นอนิเมชัน "ที่แรงขึ้น" 1 รอบ 3.5 วินาที และหน่วงเวลาเล็กน้อย) */
    animation: pulse-gradient-shadow-strong 3.5s ease-in-out 1;
    animation-delay: 0.2s; 
}

/* 4. แก้ไข :hover เมื่อปุ่ม Active (ป้องกันอนิเมชันกระตุก) */
.search-tab-button.search-tab-resume.active:hover {
    transform: translateY(-2px); 
    box-shadow: 0 10px 60px 15px rgba(229, 46, 113, 0.7), /* (ใช้เงาที่แรงที่สุดตอน Hover) */
                inset 0 3px 5px rgba(255,255,255,0.3);
}

/* 5. สไตล์ Hover "ปกติ" (เมื่อปุ่มเรียนต่อฯ "ไม่" Active) */
/* (CSS ข้อ 2 .search-tab-button.search-tab-resume:not(.active):hover ได้จัดการไว้แล้ว) */


/* ========================================================
 * (*** GEMINI-MOD-V7: END - Tab State & Stronger Animation ***)
 * ========================================================
 */


/* ========================================================
 * (*** GEMINI-MOD-V3: START - Resume Course Modal Styles ***)
 * (*** โค้ดส่วนนี้ยังคงเดิม ***)
 * ========================================================
 */

.resume-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* พื้นหลังสีเทาเข้มโปร่งใส */
    z-index: 2000; /* ให้อยู่บนสุด */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto; /* (เผื่อเนื้อหายาว) */

    /* (เพิ่ม transition สำหรับ Fade In/Out) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s; /* (GEMINI: แก้ไข visibility transition) */
}

/* (GEMINI: เพิ่ม .fadeIn/.fadeOut ที่ JS จะใช้) */
.resume-modal-overlay.fadeIn {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s; /* (GEMINI: แก้ไข visibility transition) */
}

.resume-modal-content {
    background-color: var(--hero-bg-white, #ffffff);
    border-radius: 15px; /* โค้งมนเหมือน .hero-search-form-v2 */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 900px; /* (ความกว้างสูงสุดของ Modal) */
    max-height: 90vh; /* (ความสูงสูงสุด) */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* (เพื่อให้ .resume-modal-body scroll ได้) */
    
    /* (เพิ่ม transition สำหรับ Pop-up) */
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.resume-modal-overlay.fadeIn .resume-modal-content {
    transform: scale(1);
    opacity: 1;
}


.resume-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--hero-border-light, #e2e8f0);
    flex-shrink: 0; /* (ไม่ให้ส่วนหัวหด) */
}

.resume-modal-header h3 {
    font-size: 2.0rem; /* (ปรับขนาดตัวอักษร) */
    font-weight: 700;
    color: var(--hero-text-dark, #212529);
    margin: 0;
    line-height: 1.2;
}

.resume-modal-close-btn {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--hero-text-gray, #6c757d);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}
.resume-modal-close-btn:hover {
    color: var(--hero-text-dark, #212529);
    transform: rotate(90deg);
}

.resume-modal-body {
    padding: 30px;
    overflow-y: auto; /* (สำคัญ: ให้ส่วนนี้ scroll ได้) */
}

/* (สำคัญ: เราใช้ CSS เดิมจาก .profile-summary-v8 
   ดังนั้น .dash-course-grid และ .dash-course-card 
   จะทำงานได้เลยโดยไม่ต้องเขียนใหม่) */

/* (ปรับ Responsive ของ Modal) */
@media (max-width: 768px) {
    .resume-modal-content {
        max-width: 600px;
        max-height: 85vh;
    }
    .resume-modal-header {
        padding: 15px 20px;
    }
     .resume-modal-header h3 {
        font-size: 1.5rem;
     }
    .resume-modal-body {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    /* (ในมือถือ ให้ modal ชิดขอบบน) */
    .resume-modal-overlay {
        align-items: flex-start; 
        padding: 10px;
    }
    .resume-modal-content {
        max-height: 80vh;
    }
}

/* ========================================================
 * (*** GEMINI-MOD-V3: END - Resume Course Modal Styles ***)
 * ========================================================
 */