/**
 * Dreamweaver Visual Studio CSS Styles
 * Futurity Academy Modern High-Contrast Studio Theme
 * Zero Dark-on-Dark Contrast - Crisp, Professional, Fully Accessible
 */

/* ==========================================================================
   1. TRIGGER BUTTON & FLOATING BADGE (Only in Editing Mode)
   ========================================================================== */
#fdvs-trigger-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999990;
    display: none; /* Controlled by isEditingModeActive() in JS */
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #001736 0%, #002B5B 100%);
    color: #FED488;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: 1.5px solid #775A19;
    box-shadow: 0 10px 25px -4px rgba(0, 23, 54, 0.45), 0 4px 12px rgba(119, 90, 25, 0.3);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    user-select: none;
}
#fdvs-trigger-btn.fdvs-visible {
    display: inline-flex !important;
}
#fdvs-trigger-btn:hover {
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(135deg, #00224D 0%, #003875 100%);
    box-shadow: 0 14px 30px -4px rgba(0, 23, 54, 0.55), 0 6px 16px rgba(119, 90, 25, 0.4);
    color: #FFFFFF;
    border-color: #FED488;
}
#fdvs-trigger-btn .fdvs-trigger-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: fdvs-pulse-slow 3s infinite;
}
#fdvs-trigger-btn .fdvs-shortcut-badge {
    background: rgba(254, 212, 136, 0.25);
    border: 1px solid rgba(254, 212, 136, 0.5);
    color: #FED488;
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
}

@keyframes fdvs-pulse-slow {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.1); }
}

/* ==========================================================================
   2. MAIN STUDIO WORKSPACE OVERLAY & FRAME (High Contrast Light Studio)
   ========================================================================== */
#fdvs-workspace {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    background: #F1F5F9;
    color: #0F172A;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
#fdvs-workspace.fdvs-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Studio Header Ribbon (Deep Navy with Crisp High Contrast Controls) */
.fdvs-header {
    height: 56px;
    background: #001736;
    border-bottom: 2px solid #775A19;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    box-shadow: 0 4px 16px rgba(0, 23, 54, 0.25);
    z-index: 100;
    flex-shrink: 0;
}
.fdvs-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.fdvs-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 15.5px;
    color: #FED488;
    letter-spacing: 0.3px;
}
.fdvs-logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #FED488 0%, #E8B958 100%);
    color: #001736;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(254, 212, 136, 0.4);
}
.fdvs-target-pill {
    background: #FFFFFF;
    border: 1.5px solid #FED488;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: #001736;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.fdvs-target-pill strong {
    color: #775A19;
}

/* Center Controls: View Switcher & Viewports */
.fdvs-center-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.fdvs-btn-group {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.fdvs-group-btn {
    background: transparent;
    border: none;
    color: #E2E8F0;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.fdvs-group-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.15);
}
.fdvs-group-btn.active {
    background: #FED488;
    color: #001736;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-weight: 800;
}

/* Header Action Buttons */
.fdvs-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.fdvs-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
}
.fdvs-btn-save {
    background: linear-gradient(135deg, #8E6B1E 0%, #775A19 100%);
    color: #FFFFFF;
    border-color: #FED488;
    box-shadow: 0 2px 10px rgba(119, 90, 25, 0.5);
    font-weight: 800;
}
.fdvs-btn-save:hover {
    background: linear-gradient(135deg, #A47D23 0%, #8E6B1E 100%);
    box-shadow: 0 4px 14px rgba(254, 212, 136, 0.4);
    transform: translateY(-1px);
}
.fdvs-btn-secondary {
    background: #FFFFFF;
    color: #001736;
    border-color: #CBD5E1;
}
.fdvs-btn-secondary:hover {
    background: #F8FAFC;
    border-color: #775A19;
    color: #775A19;
}
.fdvs-btn-secondary:disabled {
    background: #E2E8F0;
    color: #94A3B8;
    border-color: #CBD5E1;
    cursor: not-allowed;
    transform: none;
}
.fdvs-btn-close {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #FCA5A5;
    font-size: 14px;
    padding: 6px 12px;
}
.fdvs-btn-close:hover {
    background: #DC2626;
    color: #FFFFFF;
    border-color: #DC2626;
}

/* ==========================================================================
   3. STUDIO BODY & PANELS LAYOUT (High Contrast Light Theme)
   ========================================================================== */
.fdvs-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    background: #F1F5F9;
}

/* Left Sidebar: Components Palette & Section Navigator */
.fdvs-left-sidebar {
    width: 290px;
    background: #FFFFFF;
    border-right: 1.5px solid #CBD5E1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}
.fdvs-sidebar-tabs {
    display: flex;
    border-bottom: 1.5px solid #CBD5E1;
    background: #F8FAFC;
}
.fdvs-tab-btn {
    flex: 1;
    padding: 12px 10px;
    background: transparent;
    border: none;
    color: #475569;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border-bottom: 3px solid transparent;
    transition: all 0.15s ease;
}
.fdvs-tab-btn:hover {
    color: #001736;
    background: #EEF2F6;
}
.fdvs-tab-btn.active {
    color: #001736;
    border-bottom-color: #775A19;
    background: #FFFFFF;
    font-weight: 800;
}
.fdvs-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

/* Component Palette Items */
.fdvs-palette-item {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.fdvs-palette-item:hover {
    border-color: #775A19;
    background: #FFFDF8;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(119, 90, 25, 0.12);
}
.fdvs-palette-icon {
    font-size: 20px;
    color: #92400E;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fdvs-palette-text h4 {
    font-size: 13px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 3px 0;
}
.fdvs-palette-text p {
    font-size: 11.5px;
    color: #475569;
    margin: 0;
    line-height: 1.4;
}

/* Target Sections List in Left Sidebar */
.fdvs-section-item {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.fdvs-section-item:hover {
    border-color: #775A19;
    background: #F8FAFC;
    transform: translateX(2px);
}
.fdvs-section-item.active {
    border-color: #775A19;
    background: #FFFDF5;
    box-shadow: 0 0 0 2px rgba(119, 90, 25, 0.25);
}
.fdvs-section-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: #92400E;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.fdvs-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center Canvas / Work Area */
.fdvs-canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #E2E8F0;
    position: relative;
}
.fdvs-viewport-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    padding: 24px;
    position: relative;
}
.fdvs-live-frame-box {
    width: 100%;
    height: 100%;
    background: #FAF8F6;
    border-radius: 16px;
    border: 2px solid #CBD5E1;
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.fdvs-live-frame-box.viewport-tablet {
    width: 768px !important;
}
.fdvs-live-frame-box.viewport-mobile {
    width: 375px !important;
}
.fdvs-live-frame-box.viewport-laptop {
    width: 1024px !important;
}

/* Split View Splitter and Code Editor Panel */
.fdvs-split-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}
.fdvs-code-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-left: 1.5px solid #CBD5E1;
    overflow: hidden;
}
.fdvs-code-header {
    height: 42px;
    background: #F8FAFC;
    border-bottom: 1.5px solid #CBD5E1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 12.5px;
    font-weight: 700;
    color: #0F172A;
}
.fdvs-code-header span:last-child {
    font-size: 11.5px;
    color: #92400E;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.fdvs-ace-editor-container {
    flex: 1;
    position: relative;
}
#fdvs-ace-editor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 13.5px;
    line-height: 1.55;
    background: #FFFFFF !important;
    color: #0F172A !important;
}

/* Right Sidebar: Properties & Style Inspector */
.fdvs-right-sidebar {
    width: 320px;
    background: #FFFFFF;
    border-left: 1.5px solid #CBD5E1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
}
.fdvs-inspector-header {
    padding: 14px 16px;
    background: #F8FAFC;
    border-bottom: 1.5px solid #CBD5E1;
    font-size: 13.5px;
    font-weight: 800;
    color: #001736;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fdvs-selected-tag-badge {
    background: #FEF3C7;
    border: 1.5px solid #FDE68A;
    color: #92400E;
    font-size: 11.5px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: monospace;
}
.fdvs-inspector-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Inspector Controls & Form Fields (High Contrast) */
.fdvs-prop-section {
    margin-bottom: 20px;
    border-bottom: 1.5px solid #E2E8F0;
    padding-bottom: 16px;
}
.fdvs-prop-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #334155;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fdvs-prop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}
.fdvs-prop-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #1E293B;
    flex-shrink: 0;
}
.fdvs-input-text,
.fdvs-input-select {
    background: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 8px !important;
    color: #0F172A !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    padding: 6px 10px !important;
    outline: none !important;
    width: 100% !important;
    transition: all 0.15s ease !important;
}
.fdvs-input-text:focus,
.fdvs-input-select:focus {
    border-color: #775A19 !important;
    box-shadow: 0 0 0 2px rgba(119, 90, 25, 0.2) !important;
}

/* Futurity Swatches Bar */
.fdvs-swatches-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.fdvs-swatch {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 1.5px solid #CBD5E1;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.fdvs-swatch:hover {
    transform: scale(1.2);
    border-color: #001736;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Interactive Box Model Diagram (Dreamweaver Spacing Box - High Contrast) */
.fdvs-box-model {
    background: #F8FAFC;
    border: 1.5px dashed #94A3B8;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    margin: 10px 0;
}
.fdvs-box-model-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #775A19;
    margin-bottom: 6px;
}
.fdvs-box-inner {
    background: #FFFFFF;
    border: 1.5px solid #0284C7;
    border-radius: 8px;
    padding: 10px;
}
.fdvs-box-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    align-items: center;
    text-align: center;
}
.fdvs-box-input {
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    color: #0F172A;
    font-size: 12px;
    font-weight: 700;
    font-family: monospace;
    text-align: center;
    padding: 4px 2px;
    border-radius: 6px;
    width: 100%;
}
.fdvs-box-input:focus {
    border-color: #775A19;
    outline: none;
}

/* Bottom DOM Breadcrumb Bar */
.fdvs-bottom-bar {
    height: 36px;
    background: #F8FAFC;
    border-top: 1.5px solid #CBD5E1;
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
}
.fdvs-breadcrumb-item {
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
    color: #1E293B;
}
.fdvs-breadcrumb-item:hover {
    background: #E2E8F0;
    color: #001736;
}
.fdvs-breadcrumb-item.active {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
    font-weight: 800;
}
.fdvs-breadcrumb-separator {
    margin: 0 4px;
    color: #94A3B8;
}

/* ==========================================================================
   4. IN-FRAME VISUAL SELECTION & HOVER OVERLAY
   ========================================================================== */
.fdvs-hover-highlight {
    outline: 2px dashed #0284C7 !important;
    outline-offset: -2px !important;
    cursor: pointer !important;
    position: relative !important;
}
.fdvs-selected-highlight {
    outline: 3px solid #775A19 !important;
    outline-offset: -3px !important;
    position: relative !important;
    box-shadow: 0 0 0 4px rgba(254, 212, 136, 0.5) !important;
}

/* Floating Action Bubble on Selected Element (High Contrast Crisp White/Navy) */
#fdvs-element-action-bar {
    position: absolute;
    z-index: 999995;
    background: #FFFFFF;
    border: 2px solid #775A19;
    border-radius: 10px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.2);
    transform: translateY(-100%) translateY(-8px);
    pointer-events: auto;
}
.fdvs-action-btn {
    background: #F8FAFC;
    border: 1.5px solid #CBD5E1;
    color: #0F172A;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}
.fdvs-action-btn:hover {
    background: #FEF3C7;
    border-color: #FDE68A;
    color: #92400E;
}

/* Floating Inline Rich Text Formatting Toolbar */
#fdvs-inline-richtext-bar {
    display: none;
    position: absolute;
    z-index: 999996;
    background: #FFFFFF !important;
    border: 2px solid #775A19 !important;
    border-radius: 10px !important;
    padding: 5px 8px !important;
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.2) !important;
    align-items: center;
    gap: 6px;
}
#fdvs-inline-richtext-bar .fdvs-action-btn {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    color: #0F172A;
}
#fdvs-inline-richtext-bar .fdvs-action-btn:hover {
    background: #FEF3C7;
    border-color: #FDE68A;
    color: #92400E;
}

/* Toast Notifications (High Contrast) */
#fdvs-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000000;
    padding: 14px 22px;
    border-radius: 14px;
    background: #FFFFFF;
    color: #0F172A;
    font-size: 13.5px;
    font-weight: 700;
    border: 2px solid #001736;
    box-shadow: 0 12px 32px rgba(0, 23, 54, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
#fdvs-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
#fdvs-toast.success {
    border-color: #059669;
    background: #ECFDF5;
    color: #065F46;
}
#fdvs-toast.error {
    border-color: #DC2626;
    background: #FEF2F2;
    color: #991B1B;
}
#fdvs-toast.info {
    border-color: #775A19;
    background: #FFFDF5;
    color: #78350F;
}

/* Revisions Modal (High Contrast) */
#fdvs-revisions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}
#fdvs-revisions-modal.active {
    opacity: 1;
    visibility: visible;
}
.fdvs-modal-card {
    width: 640px;
    max-width: 92vw;
    max-height: 82vh;
    background: #FFFFFF;
    border: 2px solid #775A19;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 23, 54, 0.35);
}
.fdvs-modal-header {
    padding: 16px 20px;
    background: #001736;
    border-bottom: 2px solid #775A19;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    color: #FED488;
    font-size: 15px;
}
.fdvs-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    background: #F8FAFC;
}
.fdvs-rev-item {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.fdvs-rev-item:hover {
    border-color: #775A19;
    background: #FFFDF8;
}
