:root {
    --primary: #EA3813;
    --text-main: #1F1E1D;
    --text-sub: #524E4C;
    --line: #f9f5f3;
    --bg-blur: #FFE055;
    --bg-app: #FFFFFF;
    --bg-card: #FFFFFF;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.04);
}

body {
    background-color: var(--bg-app);
    font-family: 'Anuphan', sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: var(--bg-app);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.bg-red-theme {
    background-color: var(--primary) !important;
}

.bottom-sheet-card {
    background-color: var(--bg-card);
    border-radius: 32px 32px 0 0;
    padding: 32px 24px 120px 24px;
    width: 100%;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 20;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blur-circle {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 320px;
    height: 320px;
    background-color: var(--bg-blur);
    filter: blur(100px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

.content-wrapper {
    position: relative;
    z-index: 10;
    padding: 24px 20px;
    flex-grow: 1;
}

.app-header {
    height: auto;
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 32px 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
    z-index: 100;
    background: transparent;
}

.header-logo {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.5px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: 0.3s;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1001;
    transition: 0.3s;
    padding: 24px 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar.open {
    right: 0;
}

.sidebar-item {
    padding: 16px 24px;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
}

.sidebar-item:active {
    background: #f5f5f5;
}

h4 {
    font-weight: 700;
    color: var(--text-main);
}

.text-sub {
    color: var(--text-sub);
    font-size: 14px;
}

.form-label {
    color: var(--text-main);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(234, 56, 19, 0.1);
    outline: none;
}

.btn-primary {
    background-color: var(--primary) !important;
    border: none !important;
    border-radius: 12px;
    padding: 14px;
    font-weight: 600;
    color: white !important;
    transition: 0.2s;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: #D12E0D !important;
}

.btn-primary:disabled {
    opacity: 0.7;
}

.btn-outline {
    background-color: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.fixed-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    z-index: 900;
    display: flex;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.view-section {
    display: none;
    flex-grow: 1;
    flex-direction: column;
}

.view-active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.job-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 16px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: var(--shadow-card);
}

.section-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.job-card:active {
    transform: scale(0.98);
}

.tag-pill {
    border-radius: 50rem;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.tag-new {
    background-color: var(--primary);
    color: white;
    margin-left: 8px;
}

.tag-normal {
    background-color: white;
    border: 1px solid var(--line);
    color: var(--text-main);
}

.tag-course {
    background-color: white;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.style-tag-btn {
    border-radius: 50rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    user-select: none;
}

.sort-chip {
    border-radius: 50rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    user-select: none;
    background-color: white;
    border: 1px solid var(--line);
    color: var(--text-main);
}

.sort-chip.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.sort-chip:active {
    transform: scale(0.95);
}

.card-title-lg {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.card-label {
    color: var(--text-sub);
    font-size: 12px;
    margin-bottom: 2px;
}

.card-value {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

.card-divider {
    height: 1px;
    background-color: var(--line);
    margin: 16px 0;
}

.text-ellipsis-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.5;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E2E8F0;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.toggle-input-area {
    display: none;
    margin-top: 12px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.bottom-modal .modal-dialog {
    display: flex;
    align-items: flex-end;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

.bottom-modal .modal-content {
    border-radius: 24px 24px 0 0;
    border: none;
    max-height: 90vh;
    overflow-y: auto;
    padding-bottom: 20px;
    width: 100%;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: 0.3s;
}

.step-circle.active {
    background-color: white;
    color: var(--primary);
    border-color: white;
}

.step-line-white {
    width: 24px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.6);
    margin: 0 4px;
    transition: 0.3s;
}

.upload-box-profile {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
}

.upload-box-edu {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    background: #FAFAFA;
}

.input-invalid {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(234, 56, 19, 0.1) !important;
    background-color: #FFF5F5 !important;
}

.tutor-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.req-change-box {
    background-color: #FFF3ED;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.tutor-profile-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--line);
    background-color: #FAFAFA;
}

.section-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background-color: var(--line);
}

.teaching-history-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-sub);
    line-height: 1.6;
    white-space: pre-wrap;
    transition: 0.3s ease;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more-link {
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    display: inline-block;
    margin-top: 8px;
}

.success-circle-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

/* ============================================================
   UX ENHANCEMENTS — ปรับปรุงจาก UI UX Pro Max Best Practices
   ============================================================ */

/* --- 1. Semantic Colors & Shadow System --- */
:root {
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --info: #0284C7;
    --info-bg: #F0F9FF;
    --destructive: #DC2626;
    --destructive-bg: #FEF2F2;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* --- 2. Micro-interactions & Animation --- */

/* Skeleton Loading (แสดงขณะรอ API โหลดข้อมูล) */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 10px;
    width: 60%;
    margin-bottom: 6px;
}

.skeleton-title {
    height: 18px;
    width: 70%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* Button Loading State (ป้องกัน double-click + แสดงสถานะกำลังทำงาน) */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

.btn-loading::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Success/Error Feedback Animations */
@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-anim {
    animation: successPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.error-shake {
    animation: shake 0.4s ease;
}

/* --- 3. Pre-delivery Checklist (Accessibility) --- */

/* cursor: pointer สำหรับทุก interactive element */
[onclick],
[role="button"],
.sort-chip,
.style-tag-btn,
.read-more-link {
    cursor: pointer;
    touch-action: manipulation;
}

/* Focus States สำหรับ keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 8px;
}

.btn-primary:focus-visible {
    outline-color: #D12E0D;
    box-shadow: 0 0 0 3px rgba(234, 56, 19, 0.25);
}

.form-control:focus-visible,
.form-select:focus-visible {
    outline: none;
}

/* Reduced Motion — เคารพ user preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .skeleton {
        animation: none;
        background: #f0f0f0;
    }
}

/* --- 4. Touch Target & Mobile UX --- */

/* ทุกปุ่มต้อง minimum 44x44px ตาม WCAG touch target guidelines */
.btn-primary,
.btn-outline {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-chip,
.style-tag-btn {
    min-height: 36px;
}

.sidebar-item {
    min-height: 48px;
}

/* ป้องกัน pull-to-refresh โดยไม่ตั้งใจ */
body {
    overscroll-behavior-y: contain;
}

/* ปรับปรุง active state ให้รู้สึก responsive มากขึ้น */
.btn-primary:active {
    transform: scale(0.97);
}

.btn-outline:active {
    transform: scale(0.97);
    background-color: #FAFAFA;
}

.sidebar-item:active {
    background-color: #f5f5f5;
    transition: background-color 0.1s;
}

/* --- 5. Form UX Improvements --- */

/* Smooth transition สำหรับ input focus */
.form-control,
.form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* --- 6. Empty State Component --- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-sub);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-sub);
}

/* --- 7. Typography Scale --- */
.text-hero {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.text-h1 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
}

.text-h2 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
}

.text-h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
}

.text-body {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-main);
}

.text-sm {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-sub);
}

.text-xs {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-sub);
}

/* Semantic status text colors */
.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-destructive {
    color: var(--destructive) !important;
}

/* Semantic status backgrounds (pill-style badges) */
.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 50rem;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    padding: 4px 10px;
    border-radius: 50rem;
    font-size: 12px;
    font-weight: 600;
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
    padding: 4px 10px;
    border-radius: 50rem;
    font-size: 12px;
    font-weight: 600;
}

.badge-destructive {
    background-color: var(--destructive-bg);
    color: var(--destructive);
    padding: 4px 10px;
    border-radius: 50rem;
    font-size: 12px;
    font-weight: 600;
}

/* Edit Profile Button Styling matching Ref Image */
.btn-edit-profile {
    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 50rem;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-height: auto;
}

.btn-edit-profile:hover {
    background-color: #FAFAFA;
    border-color: var(--line);
}

.btn-edit-profile:active {
    transform: scale(0.95);
    background-color: #F1F5F9;
}

.btn-edit-profile svg {
    color: var(--text-main);
    stroke-width: 2.5;
}

/* --- 8. Compact Academic Timeline --- */
.education-timeline-container {
    position: relative;
    padding-left: 16px;
    margin-left: 8px;
    border-left: 1.5px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.education-timeline-item {
    position: relative;
    padding-bottom: 2px;
}

.education-timeline-node {
    position: absolute;
    left: -22.5px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 1px var(--line);
}

.education-timeline-content {
    font-size: 14px;
    line-height: 1.4;
}

.education-timeline-title {
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.education-timeline-subtitle {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-sub);
    margin-top: 2px;
}

.education-timeline-institution {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    margin: 4px 0 2px 0;
}

.education-verified-badge {
    color: #10B981;
    /* Green check */
    font-weight: bold;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

/* Form education item styling inside modal */
.modal-edu-row {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    background: #FFFFFF !important;
    margin-bottom: 16px;
    position: relative;
    box-shadow: var(--shadow-card);
}

.modal-edu-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.btn-remove-edu {
    background: transparent;
    border: none;
    color: var(--destructive);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-remove-edu:hover {
    opacity: 0.8;
}

/* =======================================================
   ✨ Apple-Style Floating Bottom Navbar
   ======================================================= */
.floating-navbar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px; /* 480px (app-container max-width) - 32px margins */
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-navbar-inner {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    padding: 8px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.floating-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    flex-basis: 0;
    padding: 10px 4px;
    color: var(--text-sub);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    position: relative;
    user-select: none;
}

.floating-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-sub);
    stroke-width: 2;
    transition: all 0.2s ease;
    margin-bottom: 3px;
}

.floating-nav-item span {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Active State: Beautiful Oval Pill Highlight */
.floating-nav-item.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.floating-nav-item.active svg {
    stroke: var(--primary);
    transform: translateY(-1px);
}

.floating-nav-item.active span {
    font-weight: 700;
    color: var(--primary);
}

/* Press Animation */
.floating-nav-item:active {
    transform: scale(0.92);
}

/* Tutor Profile Thumbnail in Navbar */
.nav-profile-pic-container {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.floating-nav-item.active .nav-profile-pic-container {
    border-color: var(--primary);
}

.nav-profile-pic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure container elements compensate for bottom bar */
.has-bottom-navbar {
    padding-bottom: 120px !important;
}

/* --- 9. Notes Timeline & Quill Customizations --- */
.notes-timeline-container {
    position: relative;
    padding-left: 20px;
    margin-left: 10px;
    border-left: 1.5px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.notes-timeline-item {
    position: relative;
    padding-bottom: 2px;
}

.notes-timeline-node {
    position: absolute;
    left: -26.5px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 1px var(--line);
}

.notes-timeline-content {
    font-size: 14px;
    line-height: 1.5;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line);
}

.notes-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 6px;
}

.notes-timeline-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 14px;
}

.notes-timeline-actions {
    display: flex;
    gap: 8px;
}

.notes-timeline-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-timeline-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.notes-timeline-btn:hover {
    color: var(--primary);
}

.notes-timeline-btn.btn-delete:hover {
    color: #dc3545;
}

.notes-timeline-time-info {
    font-size: 11px;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Quill Editor Styles inside notes-timeline */
.ql-container.ql-snow {
    border: 1px solid var(--line) !important;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    font-family: 'Anuphan', sans-serif !important;
    font-size: 14px !important;
}

.ql-toolbar.ql-snow {
    border: 1px solid var(--line) !important;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background-color: #f8fafc;
    border-bottom: none !important;
}

/* Quill content styling */
.ql-editor {
    min-height: 120px;
    max-height: 250px;
}

.notes-text-display {
    color: var(--text-main);
}
.notes-text-display ul, .notes-text-display ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

.notes-text-display p {
    margin-bottom: 8px;
}

.notes-text-display p:last-child, .notes-text-display ul:last-child, .notes-text-display ol:last-child {
    margin-bottom: 0;
}

/* Contact parent buttons */
.contact-parent-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-contact-parent {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background-color: var(--bg-card);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-contact-parent:hover {
    background-color: var(--line);
    color: var(--text-main);
}

.btn-contact-parent.btn-call {
    border-color: var(--text-main);
    color: var(--text-main);
    background-color: #ffffff;
}

.btn-contact-parent.btn-call:hover {
    background-color: var(--line);
    color: var(--text-main);
}

.btn-contact-parent.btn-line {
    border-color: var(--success);
    color: var(--success);
    background-color: var(--success-bg);
}

.btn-contact-parent.btn-line:hover {
    background-color: var(--success);
    color: #ffffff;
}

/* Line clamp 4 with read more */
.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.note-expanded {
    -webkit-line-clamp: unset !important;
    display: block !important;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 0;
    margin-top: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
}

.read-more-btn:hover {
    text-decoration: underline;
}

/* LINE Friendship Warning Banner */
.line-friend-alert {
    background-color: #FFFBEB; /* warm light gold */
    border: 1px solid #FEF3C7;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.04);
    animation: fadeInSlide 0.3s ease-out;
}

.line-friend-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.line-friend-icon {
    font-size: 20px;
    color: #D97706;
    line-height: 1;
}

.line-friend-text {
    font-size: 13.5px;
    color: #92400E;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
}

.line-friend-text strong {
    font-weight: 700;
}

.btn-line-friend-action {
    background-color: #06C755; /* LINE Green */
    color: #FFFFFF !important;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    box-shadow: 0 4px 8px rgba(6, 199, 85, 0.2);
}

.btn-line-friend-action:hover {
    background-color: #05B04B;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(6, 199, 85, 0.3);
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =======================================================
   ✨ Glassmorphism Fullscreen Loader Overlay
   ======================================================= */
#modalLoading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: all 0.3s ease;
}

#modalLoading .spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 4px;
    color: var(--primary) !important;
}

#modalLoading p {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}