/* ====================================== */
/* --- Profile Page Styles (v3) (START) --- */
/* ====================================== */
.profile-layout-container { max-width: 1200px; margin: 30px auto; padding: 0 24px; display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: start; }
.profile-sidebar { background: var(--bg-white); border-radius: 12px; padding: 20px 0; border: 1px solid var(--border-color); box-shadow: var(--shadow); position: sticky; top: 85px; max-height: calc(100vh - 115px); overflow-y: auto; }
.profile-sidebar h4 { font-size: 1.375rem; font-weight: 700; margin-bottom: 15px; padding: 0 20px 15px 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 10px; color: var(--primary-color); }
.profile-sidebar h4 i { font-size: 1.25rem; }
.profile-nav a.profile-nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; font-size: 1.375rem; font-weight: 500; color: var(--text-color); border-left: 4px solid transparent; transition: all 0.2s ease; }
.profile-nav a.profile-nav-link i { width: 1.25rem; text-align: center; color: var(--text-muted); font-size: 1rem; }
.profile-nav a.profile-nav-link:hover { background-color: var(--bg-light); color: var(--primary-color); }
.profile-nav a.profile-nav-link.active { background-color: #eef2ff; color: var(--primary-color); font-weight: 600; border-left-color: var(--primary-color); }
.profile-nav a.profile-nav-link.active i { color: var(--primary-color); }
.profile-nav a.logout-link { color: var(--danger-color); border-top: 1px solid #eee; margin-top: 15px; }
.profile-nav a.logout-link:hover { background-color: #f8d7da; }
.profile-nav a.logout-link i { color: var(--danger-color); }
.profile-content { min-width: 0; }
.profile-section { display: none; margin-bottom: 30px; }
.profile-section.active { display: block; }
.profile-content h2 { font-size: 1.875rem; font-weight: 700; margin-bottom: 25px; }
.card-profile { background: var(--bg-white); border-radius: 12px; padding: 25px; border: 1px solid var(--border-color); box-shadow: var(--shadow); }
.card-profile h4 { font-size: 1.375rem; font-weight: 600; margin-top: 0; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f1f3f5; }
.dashboard-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.stat-card { background: var(--bg-white); border-radius: 12px; padding: 20px; border: 1px solid var(--border-color); box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 16px; }
.stat-card-icon { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.stat-card-icon i { font-size: 1.25rem; }
.stat-card-content h3 { font-size: 1.875rem; font-weight: 700; margin: 0 0 4px 0; line-height: 1.2; }
.stat-card-content p { font-size: 1.125rem; color: var(--text-muted); margin: 0; }
.dashboard-grid-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; align-items: start; }
.time-breakdown-card .breakdown-list { display: flex; flex-direction: column; gap: 20px; }
.time-breakdown-card .breakdown-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.time-breakdown-card .breakdown-title { font-weight: 600; font-size: 1.25rem; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.time-breakdown-card .breakdown-hours { font-size: 1.25rem; font-weight: 500; color: var(--text-muted); flex-shrink: 0; }
.quick-access-list { display: flex; flex-direction: column; gap: 15px; }
.quick-access-item { display: flex; align-items: center; gap: 15px; padding: 10px; border-radius: 8px; transition: background-color 0.2s ease; text-decoration: none; color: var(--text-color); }
.quick-access-item:hover { background-color: #f8f9fa; }
.quick-access-img { width: 60px; height: 40px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.quick-access-content { flex-grow: 1; min-width: 0; }
.quick-access-content h5 { margin: 0; font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-access-arrow { color: var(--text-muted); font-size: 0.75rem; transition: transform 0.2s; }
.quick-access-item:hover .quick-access-arrow { transform: translateX(3px); }
.my-courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.profile-course-card .course-card { box-shadow: 0 2px 5px rgba(0,0,0,0.04); }
.status-tag { position: absolute; top: 10px; left: 10px; background-color: rgba(0, 0, 0, 0.6); color: #fff; padding: 4px 10px; border-radius: 15px; font-size: 0.75rem; font-weight: 500; backdrop-filter: blur(2px); display: flex; align-items: center; gap: 5px; }
.status-tag.status-completed { background-color: rgba(21, 128, 61, 0.8); }
.status-tag.status-inprogress { background-color: rgba(37, 99, 235, 0.8); }
.status-tag i { font-size: 0.6875rem; }
.progress-bar-container { height: 10px; background-color: #e9ecef; border-radius: 5px; overflow: hidden; margin-top: 10px; position: relative; }
.progress-bar-fill { height: 100%; background-color: var(--primary-color); border-radius: 5px; transition: width 0.3s ease; }
.progress-bar-text { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 0.9375rem; font-weight: 600; color: var(--primary-color); line-height: 1; background: rgba(255,255,255,0.7); padding: 0 3px; border-radius: 3px; }
.progress-bar-fill[style*="width: 0%;"] + .progress-bar-text, .progress-bar-fill[style*="width: 1%;"] + .progress-bar-text, .progress-bar-fill[style*="width: 2%;"] + .progress-bar-text, .progress-bar-fill[style*="width: 3%;"] + .progress-bar-text, .progress-bar-fill[style*="width: 4%;"] + .progress-bar-text { display: none; }
.profile-card-footer { padding-top: 15px; margin-top: 15px; border-top: 1px solid #f1f3f5; }
.profile-card-footer .btn-primary, .profile-card-footer .btn-secondary { padding: 8px 10px; font-size: 0.875rem; }
.profile-card-footer .btn-secondary { background-color: var(--bg-light); border-color: var(--border-color); color: var(--text-color); }
.profile-card-footer .btn-secondary:hover { background-color: #e9ecef; }
.profile-form h4 { font-size: 1rem; font-weight: 600; margin-bottom: 20px; margin-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #f1f3f5; }
.profile-form h4:first-of-type { margin-top: 0; }
.profile-form .form-group { margin-bottom: 20px; }
.profile-form .form-group label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 0.875rem; }
.profile-form .form-group input { width: 100%; max-width: 450px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.9375rem; font-family: 'Sarabun', sans-serif; transition: border-color 0.2s, box-shadow 0.2s; }
.profile-form .form-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(96, 108, 255, 0.2); }
.profile-form .form-group input:disabled { background-color: #f8f9fa; cursor: not-allowed; color: #6c757d; }
.profile-form .form-group small { display: block; font-size: 0.8125rem; color: var(--text-muted); margin-top: 6px; }
.form-divider { border: 0; border-top: 1px solid #eee; margin: 30px 0; }
.profile-actions { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; display: flex; gap: 10px; }
.table-responsive { width: 100%; overflow-x: auto; border: 1px solid #eee; border-radius: 8px; }
.profile-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 600px; }
.profile-table th, .profile-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; vertical-align: middle; }
.profile-table th { background-color: #f8f9fa; font-weight: 600; color: var(--text-muted); font-size: 0.8125rem; text-transform: uppercase; }
.profile-table tbody tr:last-child td { border-bottom: none; }
.profile-table tbody tr:hover { background-color: #fcfcff; }
.profile-table td { color: var(--text-color); }
.profile-table td .btn-sm { padding: 5px 10px; font-size: 0.75rem; white-space: nowrap; }
@media (max-width: 992px) { .profile-layout-container { grid-template-columns: 200px 1fr; gap: 25px; } .dashboard-grid-secondary { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .profile-layout-container { grid-template-columns: 1fr; padding: 0 15px; margin-top: 20px; }
    .profile-sidebar { position: static; margin-bottom: 25px; max-height: none; padding: 10px 0; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .profile-sidebar h4 { display: none; } .profile-nav { display: flex; border-bottom: 1px solid #eee; padding: 0 15px; }
    .profile-nav a.profile-nav-link { border-left: none; border-bottom: 3px solid transparent; padding: 10px 15px; margin-right: 5px; border-radius: 6px 6px 0 0; }
    .profile-nav a.profile-nav-link.active { border-left: none; border-bottom-color: var(--primary-color); background-color: transparent; }
    .profile-nav a.profile-nav-link.active i { display: none; }
    .profile-nav a.logout-link { border-top: none; margin-top: 0; margin-left: auto; border-bottom-color: transparent !important; }
    .profile-nav a.logout-link:hover { background-color: transparent; color: var(--danger-hover-color); }
    .profile-content h2 { font-size: 1.25rem; } .dashboard-stats-grid { grid-template-columns: 1fr; } .my-courses-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .profile-table thead { display: none; } .profile-table, .profile-table tbody, .profile-table tr, .profile-table td { display: block; width: 100%; } .profile-table { min-width: unset; }
    .table-responsive { border: none; }
    .profile-table tr { margin-bottom: 15px; border: 1px solid #eee; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
    .profile-table td { text-align: right; padding: 12px 15px; position: relative; padding-left: 50%; border-bottom: 1px solid #f1f1f1; }
    .profile-table td:last-child { border-bottom: none; text-align: center; padding-left: 15px; background: #fdfdfd; }
    .profile-table td::before { content: attr(data-label); position: absolute; left: 15px; width: calc(50% - 30px); text-align: left; font-weight: 600; color: var(--text-color); white-space: nowrap; }
    .profile-table td:last-child::before { display: none; }
}
/* ====================================== */
/* --- Profile Page Styles (v3) (END) --- */
/* ====================================== */

/* ====================================== */
/* --- (*** เพิ่มใหม่ V2) Profile Page Upgrades (START) --- */
/* (สไตล์ของการ์ดแบบใหม่ในหน้า My Courses) */
/* ====================================== */

/* (ดีไซน์การ์ด "ใหญ่" สำหรับหน้า My Courses) */
.profile-course-list-v2 {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.profile-course-card-large {
    display: grid;
    grid-template-columns: 180px 1fr; /* รูป | เนื้อหา */
    gap: 25px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.profile-course-card-large:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.large-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 180px;
}

.large-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.large-card-content h3 {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
}
.large-card-content .instructor-name.small {
    font-size: 1rem; /* 16px */
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* (ส่วน Progress Bar ใหญ่) */
.large-progress-wrapper {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 80px 1fr; /* % | แถบ */
    align-items: center;
    gap: 15px;
}
.large-progress-percent {
    font-size: 2.5rem; /* 40px */
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    text-align: right;
}
.large-progress-percent span {
    font-size: 1rem; /* 16px */
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 2px;
}
.large-progress-bar-container {
    width: 100%;
    height: 16px; /* (ใหญ่ขึ้น) */
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}
.large-progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 8px;
    transition: width 0.5s ease;
}
.large-progress-text {
    grid-column: 2 / 3; /* (ให้ข้อความอยู่ใต้แถบ) */
    font-size: 0.875rem; /* 14px */
    color: var(--text-muted);
    margin-top: -10px; /* (ดึงขึ้นไปชิดแถบ) */
}

.large-card-footer {
    margin-top: auto; /* (ดันปุ่มลงล่างสุด) */
    padding-top: 15px;
    border-top: 1px solid #f1f3f5;
}
.large-card-footer .btn-primary {
    font-size: 1rem; /* 16px */
    padding: 10px 20px;
}


/* (ดีไซน์ฟอร์มรีวิว - Logic 5) */
.review-form-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.review-form {
    padding: 0; /* (ใช้ padding ของ card-profile ไม่ได้) */
    overflow: hidden;
    transition: opacity 0.5s ease;
}
.review-form-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-light);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}
.review-form-img {
    width: 75px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.review-form-header h5 {
    margin: 0;
    font-size: 1.1rem; /* 18px */
}
.review-form-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.review-form-body label {
    font-size: 0.875rem; /* 14px */
    font-weight: 600;
    margin-bottom: -10px;
}
.review-form-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9375rem; /* 15px */
    font-family: 'Sarabun', sans-serif;
    resize: vertical;
    min-height: 80px;
}
.review-form-body .btn-submit-review {
    align-self: flex-start; /* (ให้ปุ่มอยู่ซ้าย) */
    font-size: 0.875rem;
    padding: 8px 15px;
}

/* (ดีไซน์ดาว - Logic 5) */
.star-rating {
    font-size: 1.75rem; /* 28px */
    color: #e0e0e0; /* (สีดาวกรอบ) */
    cursor: pointer;
}
.star-rating .fa-star {
    margin-right: 5px;
    transition: color 0.2s ease;
}
.star-rating .fa-star.text-warning {
    color: #ffc107; /* (สีดาวเต็ม) */
}
.star-rating .fa-star.text-warning-hover {
    color: #ffda6a; /* (สีดาวตอน Hover) */
}

/* (ข้อความ Error/Success - Logic 5) */
.review-form-message {
    font-size: 0.875rem;
    padding: 10px;
    border-radius: 6px;
    margin-top: 5px;
}
.review-form-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.review-form-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}


/* (Responsive สำหรับการ์ดใหญ่) */
@media (max-width: 768px) {
    .profile-course-card-large {
        grid-template-columns: 1fr; /* (รูปอยู่บน) */
    }
    .large-card-img {
        min-height: 0;
        height: 180px; /* (กำหนดความสูงคงที่) */
    }
    .large-progress-wrapper {
        grid-template-columns: 70px 1fr; /* (ย่อ % ลง) */
        gap: 10px;
    }
    .large-progress-percent {
        font-size: 2rem; /* 32px */
    }
}
/* ====================================== */
/* --- (*** END: Profile Page Upgrades ***) --- */
/* ====================================== */