/* ============================================================= */
/* THEME OPTION DRAWER & CONTROLS (CHUẨN DOITUONGTAC.COM 100%)   */
/* ============================================================= */

/* Backdrop làm mờ khi mở Drawer */
.theme-option-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1048;
    opacity: 0;
    visibility: hidden;
    display: none !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-option-backdrop.open {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Khung Drawer trượt ra từ cạnh phải */
.theme-option-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    overflow: hidden;
}
.theme-option-drawer.open {
    transform: translateX(0);
}

/* Nút Theme Option tab di chuyển cùng Drawer khi mở */
.theme-option-tab {
    z-index: 1051 !important;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, color 0.2s, box-shadow 0.2s;
}
.theme-option-tab.drawer-open {
    right: 320px;
}

/* ---------------- Drawer Header ---------------- */
.theme-opt-header {
    background: var(--primary-color, #206bc4);
    padding: 16px 16px 14px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.3s ease;
}
.theme-opt-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
}
.theme-opt-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin: 0;
}
.theme-opt-close-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-opt-close-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-50%) scale(1.05);
}

/* Sub-tab "Settings" */
.theme-opt-tab-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 9px 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.theme-opt-tab-text {
    color: var(--primary-color, #206bc4);
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
    transition: color 0.3s;
}
.theme-opt-tab-indicator {
    width: 24px;
    height: 2.5px;
    background: var(--primary-color, #206bc4);
    border-radius: 2px;
    margin: 3px auto 0;
    transition: background 0.3s;
}

/* ---------------- Drawer Body ---------------- */
.theme-opt-body {
    padding: 18px 20px 80px;
    overflow-y: auto;
    flex: 1;
}
.theme-opt-body::-webkit-scrollbar {
    width: 5px;
}
.theme-opt-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.theme-opt-section {
    margin-bottom: 22px;
}
.theme-opt-heading {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

/* Theme Mode Radios */
.theme-mode-radios {
    display: flex;
    align-items: center;
    gap: 32px;
}
.theme-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}
.theme-radio-label input[type="radio"] {
    display: none;
}
.radio-custom {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #ffffff;
}
.theme-radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color, #206bc4);
}
.theme-radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary-color, #206bc4);
}
.radio-text {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
}

/* Font Family Select */
.theme-font-select-wrapper {
    position: relative;
}
.theme-font-select {
    width: 100%;
    height: 42px;
    padding: 0 34px 0 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.theme-font-select:focus {
    border-color: var(--primary-color, #206bc4);
    background: #ffffff;
}
.theme-font-select-wrapper .select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 12px;
    pointer-events: none;
}

/* Sidebar Style Grid */
.sidebar-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.sidebar-style-card {
    cursor: pointer;
    text-align: left;
}
.sidebar-mockup {
    width: 100%;
    height: 44px;
    border: 1.5px solid #0f172a;
    border-radius: 6px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}
.sidebar-style-card.active .sidebar-mockup {
    border-color: var(--primary-color, #206bc4) !important;
    box-shadow: 0 0 0 1.5px var(--primary-color, #206bc4);
}
.sidebar-style-name {
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
    margin-top: 5px;
    transition: color 0.2s;
}
.sidebar-style-card.active .sidebar-style-name {
    color: var(--primary-color, #206bc4);
    font-weight: 600;
}

/* Mockup Layouts */
.mockup-full .mockup-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 28%;
    background: var(--primary-color, #206bc4);
}
.mockup-mini .mockup-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #0f172a;
}
.mockup-compact .mockup-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    background: #0f172a;
}
.mockup-modern .mockup-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    background: #0f172a;
}
.mockup-modern .mockup-top-box {
    position: absolute;
    left: 14px;
    top: 0;
    width: 14px;
    height: 18px;
    background: #94a3b8;
}
.mockup-overlay .mockup-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 22px;
    background: #0f172a;
}
.mockup-overlay .mockup-overlay-shade {
    position: absolute;
    left: 22px;
    right: 0;
    top: 0;
    bottom: 0;
    background: #94a3b8;
}
.mockup-icon-hover .mockup-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 4px 0;
}
.mockup-icon-hover .mockup-bar span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffffff;
    display: block;
}

/* Theme Toggles */
.theme-toggles-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.theme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.toggle-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
}
.toggle-icon {
    font-size: 15px;
    width: 18px;
    color: #0f172a;
    text-align: center;
}
.toggle-icon-svg {
    stroke: #0f172a;
    flex-shrink: 0;
}
.toggle-text {
    font-size: 13.5px;
    font-weight: 500;
    color: #64748b;
}

/* iOS-Style Toggle Switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    border-radius: 22px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.switch-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-switch input:checked + .switch-slider {
    background-color: var(--primary-color, #206bc4);
}
.theme-switch input:checked + .switch-slider::before {
    transform: translateX(18px);
}

/* Primary Color Swatches */
.theme-color-swatches {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.color-swatch-item {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 11px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    flex-shrink: 0;
}
.color-swatch-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.color-swatch-item.active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--primary-color, #206bc4);
}
.swatch-white {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}
.swatch-purple {
    background: linear-gradient(180deg, #7c3aed 0%, #a78bfa 100%);
}
.swatch-teal {
    background: linear-gradient(180deg, #0d9488 0%, #5eead4 100%);
}
.swatch-coral {
    background: linear-gradient(180deg, #f43f5e 0%, #fda4af 100%);
}
.swatch-dark {
    background: linear-gradient(180deg, #334155 0%, #64748b 100%);
}
.swatch-blue {
    background: linear-gradient(180deg, #206bc4 0%, #74c0fc 100%);
}
.swatch-yellow {
    background: linear-gradient(180deg, #d97706 0%, #fde68a 100%);
}
.swatch-pink {
    background: linear-gradient(180deg, #db2777 0%, #f472b6 100%);
}

/* ------------------------------------------------------------- */
/* DARK THEME STYLING                                            */
/* ------------------------------------------------------------- */
body.dark-mode {
    --bg-body: #0b0f19;
    --text-color: #cbd5e1;
    --heading-color: #f8fafc;
    background-color: #0b0f19 !important;
    color: #cbd5e1 !important;
}
body.dark-mode .header {
    background: #111827 !important;
    border-bottom-color: #1f2937 !important;
}
body.dark-mode .header .header-content {
    color: #f1f5f9;
}
body.dark-mode .theme-option-drawer {
    background: #111827 !important;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
}
body.dark-mode .theme-opt-heading,
body.dark-mode .radio-text,
body.dark-mode .toggle-text {
    color: #e2e8f0 !important;
}
body.dark-mode .toggle-icon,
body.dark-mode .toggle-icon-svg {
    color: #e2e8f0 !important;
    stroke: #e2e8f0 !important;
}
body.dark-mode .theme-font-select {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}
body.dark-mode .sidebar-mockup {
    border-color: #475569 !important;
    background: #1e293b !important;
}
body.dark-mode .card,
body.dark-mode .content-card,
body.dark-mode .service-detail-section,
body.dark-mode .warning-rule-box,
body.dark-mode .panel-box,
body.dark-mode .quick-filter-bar,
body.dark-mode .modal-content,
body.dark-mode .service-form-card-3d,
body.dark-mode .guide-3d-card,
body.dark-mode .services-3d-panel,
body.dark-mode .service-order-history-card,
[data-theme="dark"] .service-form-card-3d,
[data-theme="dark"] .guide-3d-card,
[data-theme="dark"] .services-3d-panel,
[data-theme="dark"] .service-order-history-card {
    background: #111827 !important;
    border-color: #1f2937 !important;
    color: #cbd5e1 !important;
}
body.dark-mode .server-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
body.dark-mode .server-card.selected {
    border-color: var(--primary-color, #206bc4) !important;
    background: #1e293b !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f8fafc !important;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #1f2937 !important;
    border-color: var(--primary-color, #206bc4) !important;
    color: #f8fafc !important;
}
body.dark-mode .theme-opt-tab-box {
    background: #1f2937 !important;
}
