/* --- จัดระเบียบการยืดเต็มจอและแก้บัค --- */
.container-fluid {
    max-width: 1600px; /* จำกัดความกว้างสูงสุดนิดนึงไม่ให้ยาวจนกวาดสายตาลำบาก */
    margin: 0 auto;
}

/* ดีไซน์ปุ่มเลือกประสบการณ์ใหม่ให้ดูเต็มพื้นที่ */
.experience-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.exp-option-box {
    position: relative;
    display: inline-block;
}

.exp-option-box input[type="radio"],
.exp-option-box input[type="checkbox"] {
    display: none !important; /* ซ่อนวงกลมมาตรฐาน */
}

.exp-option-box .exp-toggle-input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
    appearance: none !important;
}

.exp-label {
    display: block;
    padding: 12px 25px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: #444;
}

/* เมื่อกดเลือกให้เปลี่ยนเป็นสีเหลืองทอง */
.exp-option-box input[type="radio"]:checked + .exp-label,
.exp-option-box input[type="checkbox"]:checked + .exp-label {
    background: #FFF9E6;
    border-color: #FFC107;
    color: #000;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.2);
}

.exp-select-area {
    min-width: 250px;
}

/* ปรับความสูงมาตรฐานช่องกรอกอื่นๆ (ยกเว้น textarea) */
.form-control:not(textarea), .form-select, .gender-box-sync {
    height: 42px !important;
    font-size: 0.95rem;
    border-radius: 8px;
}

textarea.form-control {
    height: auto !important;
    font-size: 0.95rem;
    border-radius: 8px;
}

/* Form control sm - ขนาดเล็กลง */
.form-control-sm, .form-select-sm {
    height: 38px !important;
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
}

/* สำหรับมือถือ: ให้เรียงเป็นแนวตั้งสวยๆ */
@media (max-width: 768px) {
    .experience-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .exp-option-box, .exp-label {
        width: 100%;
        text-align: center;
    }
}
/* --- บังคับความสูงมาตรฐานให้เท่ากันทุกช่อง (ยกเว้น textarea) --- */
.form-control:not(textarea), .form-select, .gender-box-refined {
    height: 42px !important;
    border-radius: 8px !important;
    border: 1px solid #dee2e6;
}

/* textarea ให้ใช้ความสูงตาม rows ที่กำหนด */
textarea.form-control {
    height: auto !important;
    min-height: 100px;
    border-radius: 8px !important;
    border: 1px solid #dee2e6;
}

/* --- จัดการกล่องเพศให้สมดุล --- */
.gender-box-refined {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background-color: #f8f9fa;
    padding: 0 10px;
    height: 42px !important;
}

.gender-box-refined .form-check {
    display: flex;
    align-items: center;
    gap: 8px; /* เว้นระยะระหว่างวงกลมกับตัวหนังสือ */
}

/* --- จัดระเบียบวันเกิดให้กว้างและสวยงาม --- */
.birthday-grid-custom {
    display: grid;
    grid-template-columns: 1fr 2fr 1.5fr; /* แบ่งสัดส่วน วัน(แคบ) เดือน(กว้าง) ปี(กลาง) */
    gap: 12px; /* เพิ่มระยะห่างระหว่างช่อง */
}

.birthday-grid-custom select {
    cursor: pointer;
    background-color: #f8f9fa;
    font-weight: 500;
}

/* สำหรับมือถือ: ให้ช่องวันเกิดยืดหยุ่นขึ้น */
@media (max-width: 576px) {
    .birthday-grid-custom {
        grid-template-columns: 1fr 1fr 1fr; /* ในมือถือให้กว้างเท่ากันเพื่อความสมมาตร */
        gap: 8px;
    }
}
/* --- ดีไซน์ช่องอัปโหลดบัตรประชาชน --- */
.id-upload-box {
    height: 50px !important; /* บังคับให้สูงเท่าช่อง Input */
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: 0.3s;
}

.id-upload-box:hover {
    border-color: #FFC107;
    background-color: #ffffff;
}

#idPhotoPreview img {
    height: 100%;
    width: auto;
    object-fit: contain;
    padding: 5px;
}

/* ปรับให้ในมือถือช่องเลขบัตรกับอัปโหลดห่างกันพอดี */
@media (max-width: 768px) {
    .id-upload-wrapper {
        margin-top: 5px;
    }
}

/* --- Location Dropdown Styles --- */
.location-dropdown {
    max-height: 250px;
    overflow-y: auto;
}

.dropdown-item-location:hover {
    background-color: #e3f2fd;
    color: #1565c0;
}

.location-tag-input-container {
    min-height: 38px;
    height: auto !important;
    cursor: pointer;
}

.tag-input-container {
    min-height: 38px;
    height: auto !important;
    cursor: pointer;
}

/* --- ID Card Photo Styles (Backend Style) --- */
.idcard-photo-container {
    width: 280px;
    height: 177px;
    border: 2px dashed #90caf9;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.idcard-photo-container:hover {
    border-color: #42a5f5;
    background: #e3f2fd;
}

.idcard-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.idcard-photo:hover {
    transform: scale(1.02);
}

.idcard-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.idcard-upload-wrap {
    gap: 12px;
}

.idcard-input {
    max-width: 260px;
}

/* Responsive ID Card */
@media (max-width: 768px) {
    .idcard-photo-container {
        width: 100%;
        max-width: 300px;
        height: auto;
        aspect-ratio: 1.585;
    }

    .idcard-input {
        max-width: 100%;
    }
}

/* ========== New Styles from tutor-edit-profile.php ========== */

/* Tag Pill Style (รูปแบบใหม่) */
.tag-pill {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    margin: 2px;
}

.tag-pill i {
    margin-left: 6px;
    font-size: 0.75rem;
    color: #856404;
    cursor: pointer;
    opacity: 0.7;
}

.tag-pill i:hover {
    opacity: 1;
}

.placeholder-text {
    color: #adb5bd;
    font-style: italic;
}

/* Form Divider */
.form-divider {
    height: 1px;
    background: #f1f3f5;
    margin: 2rem 0;
}

/* Subject Dropdown (ปรับให้เหมือน edit-profile) */
.subject-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 1050;
}

.dropdown-item-subject {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    font-size: 0.95rem;
}

.dropdown-item-subject:hover {
    background-color: #fff3cd;
    color: #856404;
}

/* Photo Card (ปรับให้เหมือน edit-profile) */
.photo-card {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: transform 0.2s;
}

/* Add Photo Button */
.add-photo-btn {
    border: 2px dashed #ffc107;
    background-color: #fffdf5;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.add-photo-btn:hover {
    background-color: #fff8e1;
}

/* Tag Input Container ปรับให้เหมือน edit-profile */
.tag-input-container {
    min-height: 48px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    cursor: text;
    background: #fff;
}

.tag-input-container:hover {
    border-color: #adafae;
}

/* ID Card Upload Area (จาก edit-profile) */
.idcard-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fcfcfc;
    transition: all 0.2s;
    cursor: pointer;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.idcard-upload-area:hover {
    border-color: #ffc107;
    background: #fffdf5;
}

/* Utility Classes */
.opacity-50 {
    opacity: 0.5;
}


.special-intro-box {
    position: relative;
    background: #fff;
    padding: 30px 20px 20px 20px;
    border-radius: 10px;
    border: 2px solid #dee2e6; 
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.15); 
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.special-intro-box:hover, .special-intro-box:focus-within {
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.25);
    /* transform: translateY(-2px); */
    border-color: #ffbf00;
}

.intro-decoration {
    position: absolute;
    top: -14px;
    left: 20px;
    background: #fff;
    padding: 2px 15px;
    color: #FFC107;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
    border-radius: 20px;
    border: 1px solid #FFC107;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.intro-decoration i {
    font-size: 1rem;
}

/* Override CKEditor styles for this specific box */
.special-intro-box .ck-editor__main > .ck-editor__editable {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    min-height: 300px !important; /* Give plenty of space */
    padding: 15px 20px !important;
    background-color: #fdfdfd;
    transition: background-color 0.3s;
    font-size: 1rem;
    line-height: 1.6;
}

.special-intro-box .ck-editor__main > .ck-editor__editable:focus {
    background-color: #ffffff;
    border-color: #dee2e6 !important;
    box-shadow: inset 0 0 0 1px #dee2e6 !important;
}

/* Remove CKEditor toolbar border to make it look seamless */
.special-intro-box .ck.ck-toolbar {
    border: none !important;
    background: transparent !important;
    padding-left: 0 !important;
    margin-bottom: 5px;
}