/* ============================================================
   Nice PPT - SVG Editor & Agent Workspace | style.css
   Vanilla CSS with CSS Variables & Premium Aesthetics
   ============================================================ */

/* ---------- Color Themes ---------- */
:root, :root[data-theme="dark"] {
    /* Widescreen Dark Theme - Editorial Slate & Indigo Accent */
    --primary: #4a9eff;
    --primary-hover: #3a8eef;
    --primary-light: rgba(74, 158, 255, 0.1);
    --accent: #f5c542;
    --accent-hover: #e5b532;
    
    --bg-app: #0d0d15;
    --bg-header: #131322;
    --bg-panel: #16162a;
    --bg-canvas: #09090f;
    --bg-card: #1f1f38;
    --bg-input: #1e1e36;
    --bg-chat-user: #1e3a5f;
    --bg-chat-agent: #1e1e32;
    
    --text-main: #e2e2ec;
    --text-muted: #8a8aab;
    --text-light: #ffffff;
    --border: #2a2a4a;
    --border-hover: #3a3a6a;
    --shadow: rgba(0, 0, 0, 0.4);
    --preview-slide-bg: #111116;
    
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

:root[data-theme="light"] {
    /* Day Theme - Clean Editorial White & Blue Accent */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.08);
    --accent: #d97706;
    --accent-hover: #b45309;
    
    --bg-app: #f4f5f7;
    --bg-header: #ffffff;
    --bg-panel: #ffffff;
    --bg-canvas: #e5e7eb;
    --bg-card: #f9fafb;
    --bg-input: #f3f4f6;
    --bg-chat-user: #dbeafe;
    --bg-chat-agent: #f3f4f6;
    
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --text-light: #111827;
    --border: #e5e7eb;
    --border-hover: #d1d5db;
    --shadow: rgba(0, 0, 0, 0.08);
    --preview-slide-bg: #ffffff;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-app);
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ---------- Header Layout ---------- */
#app-header {
    height: 56px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    position: relative;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background 0.3s;
}

#app-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

#app-title i {
    color: var(--primary);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-indicator {
    font-size: 13px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 99px;
    font-weight: 600;
}

.header-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.header-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.header-btn.btn-export {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff !important;
}

.header-btn.btn-export:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-lang-toggle {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: 0.2s;
}

.btn-lang-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------- Screens Container ---------- */
#screens-container {
    height: calc(100vh - 56px);
    width: 100vw;
    position: relative;
}

.screen {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* ============================================================
   SCREEN 1: DASHBOARD
   ============================================================ */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    gap: 20px;
    overflow: hidden; /* Main layout fixed */
}

.dashboard-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.dashboard-top-bar .section-title {
    margin-bottom: 0;
}

/* If no history, center the create project button card */
.dashboard-layout.no-history {
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.dashboard-layout.no-history.onboarding-active {
    justify-content: flex-start;
    align-items: stretch;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

.dashboard-layout.no-history.onboarding-active::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.dashboard-layout.no-history .projects-grid {
    display: none;
}

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

.section-title i {
    color: var(--primary);
}

/* --- Project Grid & Cards --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-content: start;
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px 24px 6px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

.projects-grid::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 16px var(--shadow);
}

.btn-delete-project {
    opacity: 0;
    transition: opacity 0.2s;
}

.project-card:hover .btn-delete-project {
    opacity: 1;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.project-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.3;
}

.project-card-format {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.project-card-details {
    font-size: 12px;
    color: var(--text-muted);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
}

.project-card-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
}

.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 15px;
}

/* --- Create Project Panel --- */
.create-project-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    height: fit-content;
    box-shadow: 0 10px 25px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-project-card .card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-input);
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 24px;
    color: var(--primary);
}

.file-list-preview {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    width: 100%;
    padding: 11px 0;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* ============================================================
   SCREEN 2: WORKSPACE & THREE-PANEL APP
   ============================================================ */
#app {
    display: flex;
    height: 100%;
    width: 100vw;
}

#panel-left {
    width: 220px;
    min-width: 220px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#panel-left .panel-header {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

#slide-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.slide-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
}

.slide-item:hover {
    background: var(--primary-light);
}

.slide-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.slide-item .slide-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.slide-item .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--accent);
    color: #1a1a2e;
    font-size: 10px;
    font-weight: 700;
}

/* --- Center Panel --- */
#panel-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    background: var(--bg-canvas);
    overflow: hidden;
}

#slide-nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
}

#svg-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 24px;
    position: relative;
}

#svg-content {
    background: transparent;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    position: relative;
}

#svg-content svg {
    display: block;
    /* Force SVG to fill container regardless of hardcoded width/height attributes.
       CSS overrides SVG presentation attributes, so a slide with width="960" height="540"
       will still scale to fill the available space at its natural aspect ratio. */
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 240px);
    overflow: hidden;
}

/* Element interactive states */
.svg-selectable {
    cursor: pointer;
    transition: outline 0.12s ease;
}

.svg-selectable:hover {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.svg-selected {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px;
}

.svg-annotated {
    outline: 2px dashed var(--accent) !important;
    outline-offset: 2px;
}

/* --- Right Panel with Tabs --- */
#panel-right {
    width: 400px;
    min-width: 400px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-tabs {
    display: flex;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
}

.tab-header {
    flex: 1;
    padding: 12px 0;
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-header:hover {
    color: var(--text-main);
}

.tab-header.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

.panel-padding {
    padding: 16px;
}

/* ============================================================
   TAB 1: CHAT WORKSPACE
   ============================================================ */
#tab-chat {
    display: none; /* Controlled by active class */
    flex-direction: column;
    height: 100%;
}

#tab-chat.active {
    display: flex;
}

/* Tab 2: Annotation panel — flex column so inner scrollable area fills remaining height */
#tab-selection {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#tab-selection.active {
    display: flex;
}

#tab-selection .panel-padding {
    flex: 1;
    overflow-y: auto;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Scrollbar */
.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}
.chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Chat Bubbles */
.chat-bubble {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 13px;
    word-break: break-word;
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--bg-chat-user);
    color: var(--text-light);
    border-bottom-right-radius: 2px;
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: var(--bg-chat-agent);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}

.chat-bubble-meta {
    font-size: 10px;
    color: var(--text-muted);
    align-self: flex-end;
    margin-top: 2px;
}

.chat-bubble.assistant p {
    margin-bottom: 8px;
}
.chat-bubble.assistant p:last-child {
    margin-bottom: 0;
}
.chat-bubble.assistant ol, .chat-bubble.assistant ul {
    margin-left: 16px;
    margin-bottom: 8px;
}
.chat-bubble.assistant li {
    margin-bottom: 4px;
}
.chat-bubble.assistant strong {
    color: var(--text-light);
}

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: var(--bg-header);
}

#chat-textarea {
    flex: 1;
    min-height: 38px;
    max-height: 120px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    resize: none;
    outline: none;
    font-size: 13px;
    line-height: 1.4;
}

#chat-textarea:focus {
    border-color: var(--primary);
}

#btn-chat-send {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-chat-send:hover {
    background: var(--primary-hover);
}

/* ============================================================
   TAB 2: SELECTION & ANNOTATION
   ============================================================ */
#tab-selection {
    padding: 16px;
    gap: 16px;
    overflow: hidden;
    height: 100%;
}

#selected-element {
    font-size: 13px;
    margin-top: 6px;
    word-break: break-all;
}

#selected-element.empty {
    color: var(--text-muted);
    font-style: italic;
}

#selected-element .el-tag {
    display: inline-block;
    padding: 2px 6px;
    background: var(--primary-light);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--primary);
    margin-right: 6px;
}

#selected-element .el-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

#element-props {
    margin-top: 10px;
    font-size: 12px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
}

.prop-table {
    width: 100%;
    border-collapse: collapse;
}

.prop-table tr {
    border-bottom: 1px solid var(--border);
}

.prop-table tr:last-child {
    border-bottom: none;
}

.prop-table td {
    padding: 6px 4px;
    vertical-align: top;
}

.prop-table .prop-key {
    color: var(--text-muted);
    width: 80px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.prop-table .prop-val {
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 11px;
}

.prop-table .prop-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
    border: 1px solid var(--border);
}

#annotation-input textarea {
    width: 100%;
    height: 60px;
    resize: none;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    outline: none;
    margin-top: 6px;
}

#annotation-input textarea:focus {
    border-color: var(--primary);
}

#btn-add-annotation {
    margin-top: 8px;
    width: 100%;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-add-annotation:hover {
    background: var(--primary-hover);
}

#annotations {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.annotation-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.annotation-item .ann-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.annotation-item .ann-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    background: rgba(245, 197, 66, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
}

.annotation-item .ann-id {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.annotation-item .ann-remove {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

.annotation-item .ann-text {
    font-size: 12px;
    color: var(--text-main);
}

/* ============================================================
   TAB 3: VERSION HISTORY
   ============================================================ */
.history-list-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: var(--primary);
}

.history-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}

.history-item-name {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-restore {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-restore:hover {
    background: var(--primary);
    color: #ffffff;
}

/* ============================================================
   MODALS & LOADERS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
}

.export-modal, #modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.export-modal h3, #modal-message {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-light);
}

.export-modal p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.spinner-large {
    font-size: 40px;
    color: var(--primary);
}

#modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

#modal-confirm {
    padding: 8px 20px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

#modal-cancel {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}

#modal-cancel:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ---------- Rubber band ---------- */
#rubber-band-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}
#rubber-band-overlay.active {
    pointer-events: auto;
}
#rubber-band {
    position: fixed;
    border: 2px dashed var(--primary);
    background: var(--primary-light);
    pointer-events: none;
    z-index: 11;
}

/* ---------- Helper Classes ---------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ============================================================
   ONBOARDING GUIDE & INTERACTIVE CTA
   ============================================================ */
.onboarding-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 40px;
    max-width: 580px;
    width: 95%;
    box-shadow: 0 20px 40px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 28px;
    transition: all 0.3s ease;
}

/* Glassmorphic touch in dark mode */
[data-theme="dark"] .onboarding-card {
    background: rgba(22, 22, 42, 0.85);
    border-color: rgba(74, 158, 255, 0.15);
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(74, 158, 255, 0.05);
}

.onboarding-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.onboarding-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

.onboarding-logo i {
    font-size: 24px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
}

.onboarding-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-light) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboarding-header p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 480px;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.onboarding-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: all 0.2s ease;
}

[data-theme="light"] .onboarding-step {
    background: rgba(0, 0, 0, 0.02);
}

.onboarding-step:hover {
    background: var(--primary-light);
    border-color: rgba(74, 158, 255, 0.1);
}

.step-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(74, 158, 255, 0.3);
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
}

.step-content p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.step-content p b {
    color: var(--text-light);
}

.onboarding-cta {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* Pulsing Button Animation */
.btn-pulse {
    position: relative;
    animation: cta-pulse-animation 2s infinite;
    padding: 12px 28px !important;
    font-size: 14px !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

@keyframes cta-pulse-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 4px 25px rgba(74, 158, 255, 0.6), 0 0 0 6px rgba(74, 158, 255, 0.15);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
    }
}

/* Background Generating Status Card */
.generating-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px;
    gap: 20px;
}

.generating-spinner {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
    margin-bottom: 8px;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

.generating-spinner i {
    font-size: 32px;
    color: var(--primary);
}

/* Attention Pulse for Chat Box */
.chat-input-area.attention-pulse {
    border-top-color: var(--primary);
    animation: chat-border-pulse 2s infinite;
    position: relative;
}

.chat-input-area.attention-pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: 0 -4px 12px rgba(74, 158, 255, 0.2);
    animation: chat-shadow-pulse 2s infinite;
}

@keyframes chat-border-pulse {
    0% {
        border-top-color: var(--border);
    }
    50% {
        border-top-color: var(--primary);
    }
    100% {
        border-top-color: var(--border);
    }
}

@keyframes chat-shadow-pulse {
    0% {
        box-shadow: 0 -4px 6px rgba(74, 158, 255, 0);
    }
    50% {
        box-shadow: 0 -4px 16px rgba(74, 158, 255, 0.25);
    }
    100% {
        box-shadow: 0 -4px 6px rgba(74, 158, 255, 0);
    }
}

/* --- Bottom Slide Preview Bar --- */
#slide-preview-bar {
    height: 130px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    overflow-x: auto;
    flex-shrink: 0;
}

#slide-preview-bar::-webkit-scrollbar {
    height: 6px;
}
#slide-preview-bar::-webkit-scrollbar-track {
    background: transparent;
}
#slide-preview-bar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.preview-card {
    width: 140px;
    height: 105px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    flex-shrink: 0;
    overflow: hidden;
}

.preview-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.preview-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-light);
    background: var(--bg-card);
}

.preview-card-thumbnail {
    width: 100%;
    height: 78px;
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.preview-card-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    overflow: hidden;
}

.preview-card-num {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.preview-card-name {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.preview-card-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--accent);
    color: #1a1a2e;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- Typing Indicator for Chat Loading --- */
.chat-bubble.assistant.loading {
    padding: 12px 20px;
    background: var(--bg-chat-agent);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 4px 15px var(--shadow);
    position: relative;
    overflow: hidden;
}

.chat-bubble.assistant.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, var(--primary-light) 50%, transparent 100%);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-30%); }
    100% { transform: translateX(30%); }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 14px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
    animation: typing-bounce 1.2s infinite ease-in-out both;
    box-shadow: 0 0 6px var(--primary);
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing-bounce {
    0%, 80%, 100% { 
        transform: scale(0.7);
        opacity: 0.3;
    } 
    40% { 
        transform: scale(1.15);
        opacity: 1;
        background: var(--primary-hover);
        box-shadow: 0 0 8px var(--primary);
    }
}

#annotation-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.annotation-item {
    transition: border-color 0.2s, box-shadow 0.2s;
}

.annotation-item:has(.ann-checkbox:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(0, 120, 212, 0.15);
}

.ann-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ann-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

#annotation-submit-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
}

#annotation-supplement {
    width: 100%;
    height: 50px;
    resize: none;
    padding: 8px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    outline: none;
}

#annotation-supplement:focus {
    border-color: var(--primary);
}

#btn-submit-annotations {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

#btn-submit-annotations:hover:not(:disabled) {
    background: var(--primary-hover);
}

#btn-submit-annotations:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--border);
    color: var(--text-muted);
}

.submit-badge {
    display: inline-block;
    background: var(--accent);
    color: #000000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* --- Duplicate Contextual Popover Styles Removed --- */


/* ============================================================
   SaaS MVP Authentication & Admin Panel Styles
   ============================================================ */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin-right: 8px;
}

.user-email-display {
    font-size: 12px;
    color: var(--text-light);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-credits-display {
    font-size: 12px;
    font-weight: bold;
    color: #FFB300;
}

.btn-activate, .btn-admin, .btn-logout {
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    height: auto !important;
}

.btn-activate {
    background: var(--primary) !important;
    color: #ffffff !important;
}

.btn-activate:hover {
    background: var(--primary-hover) !important;
}

.btn-admin {
    background: rgba(0, 210, 255, 0.1) !important;
    color: #00D1FF !important;
    border: 1px solid rgba(0, 210, 255, 0.3) !important;
}

.btn-admin:hover {
    background: rgba(0, 210, 255, 0.2) !important;
}

/* Login Card Glassmorphism */
.login-overlay {
    backdrop-filter: blur(12px) !important;
    background: rgba(10, 14, 23, 0.8) !important;
}

.login-card {
    background: rgba(26, 31, 46, 0.85);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 16px;
    padding: 32px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(74, 158, 255, 0.05);
    text-align: center;
    backdrop-filter: blur(8px);
}

.login-card-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-light) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.login-card-body .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.login-card-body label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.login-card-body .input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-card-body .input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.login-card-body input {
    width: 100%;
    padding: 10px 12px 10px 38px !important;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.login-card-body input:focus {
    border-color: var(--primary);
}

/* Modal adjustments */
.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 15px 35px var(--shadow);
    overflow: hidden;
}

.modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-card-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.btn-close-modal:hover {
    color: var(--text-light);
}

/* Admin Screen Styles */
.admin-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.admin-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-light);
    margin: 0;
}

.btn-close-admin-screen {
    padding: 8px 16px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
}

.btn-close-admin-screen:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.admin-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px var(--shadow);
}

.admin-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.w-full {
    grid-column: span 2;
}

/* Tables in Admin */
.table-container {
    overflow-x: auto;
    max-height: 300px;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

th {
    padding: 10px 8px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
}

td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   SAAS MVP GUEST MODE & PROMO BANNER STYLES
   ============================================================ */
.guest-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-login-trigger {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.btn-login-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4) !important;
}

.promo-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(91, 141, 239, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(91, 141, 239, 0.3);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
    animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(91, 141, 239, 0.05); }
    100% { box-shadow: 0 0 20px rgba(91, 141, 239, 0.15); }
}

.promo-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.promo-tag {
    background: #FFB300;
    color: #111;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.promo-text {
    font-size: 13px;
    color: var(--text-light);
}

.btn-banner-action {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-banner-action:hover {
    background: #4a7be0;
    transform: scale(1.02);
}


/* ============================================================
   LANDING PAGE — Commercial Marketing Screens
   ============================================================ */

/* Landing screen container: full-viewport, scrollable */
.landing-screen {
    overflow-y: auto;
    overflow-x: hidden;
    background: #08080f;
    scroll-behavior: smooth;
}

/* ---- Landing Nav ---- */
.landing-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 64px;
    background: rgba(8, 8, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 158, 255, 0.12);
}

.landing-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.landing-nav-brand i {
    color: var(--primary);
    font-size: 20px;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.landing-nav-link {
    color: rgba(226, 226, 236, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.landing-nav-link:hover {
    color: #ffffff;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-nav-btn-ghost {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid rgba(74, 158, 255, 0.35);
    border-radius: 8px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.landing-nav-btn-ghost:hover {
    background: rgba(74, 158, 255, 0.1);
    border-color: var(--primary);
}

.landing-nav-btn-primary {
    padding: 8px 20px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
}

.landing-nav-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(74, 158, 255, 0.45);
}

/* ---- Hero Section ---- */
.hero-section {
    position: relative;
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 100px;
    overflow: hidden;
}

/* Animated gradient orbs */
.hero-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 8s ease-in-out infinite;
    pointer-events: none;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(74, 158, 255, 0.18) 0%, transparent 70%);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    top: 100px;
    right: -150px;
    animation-delay: -3s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 197, 66, 0.08) 0%, transparent 70%);
    bottom: -100px;
    left: 40%;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 30px) scale(0.97); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 860px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(74, 158, 255, 0.12);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 99px;
    font-size: 13px;
    color: #a0c8ff;
    margin-bottom: 28px;
    animation: fadeInDown 0.6s ease both;
}

.hero-badge i {
    color: var(--accent);
}

.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 24px;
    animation: fadeInUp 0.7s ease 0.1s both;
}

.hero-title-gradient {
    background: linear-gradient(135deg, #4a9eff 0%, #8b5cf6 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 17px;
    color: rgba(226, 226, 236, 0.65);
    line-height: 1.7;
    margin-bottom: 40px;
    animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
    flex-wrap: wrap;
    animation: fadeInUp 0.7s ease 0.3s both;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #4a9eff, #7c3aed);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.35);
    letter-spacing: -0.2px;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(74, 158, 255, 0.5);
}

.btn-hero-primary.btn-sm {
    padding: 10px 24px;
    font-size: 14px;
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s;
}

.btn-hero-secondary:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    animation: fadeInUp 0.7s ease 0.4s both;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 36px;
}

.hero-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.hero-stat-label {
    font-size: 12px;
    color: rgba(226, 226, 236, 0.5);
    font-weight: 500;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Shared Section Layout ---- */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-tag {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(74, 158, 255, 0.12);
    border: 1px solid rgba(74, 158, 255, 0.25);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-heading {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.8px;
    line-height: 1.15;
    margin-bottom: 14px;
}

.section-subheading {
    font-size: 15px;
    color: rgba(226, 226, 236, 0.55);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto;
}

/* ---- Demo Carousel Section ---- */
.demo-section {
    padding: 100px 0 80px;
    background: linear-gradient(180deg, #08080f 0%, #0c0c1a 50%, #08080f 100%);
}

.demo-carousel-wrapper {
    position: relative;
    margin-bottom: 40px;
    padding: 0 0;  /* buttons sit inside the carousel */
}

.demo-carousel {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(74, 158, 255, 0.15);
    box-shadow:
        0 0 60px rgba(74, 158, 255, 0.08),
        0 24px 64px rgba(0, 0, 0, 0.5);
    background: #0a0a14;
    aspect-ratio: 16/9;
    max-height: 560px;
    width: 100%;
}

.demo-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-slide-item {
    min-width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #08080f;
    display: flex;
    align-items: stretch;
}

/* Inline SVG (fetched) inside slide item */
.demo-slide-item > svg {
    aspect-ratio: 16/9;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    overflow: hidden;
    margin: auto;
}

.demo-slide-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Loading spinner for each slide while SVG fetches */
.demo-slide-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 200px;
    font-size: 28px;
    color: var(--primary);
}

.demo-slide-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(226, 226, 236, 0.4);
    font-size: 15px;
    width: 100%;
    height: 100%;
}

.demo-slide-placeholder i {
    font-size: 28px;
    color: var(--primary);
}

/* Carousel Navigation Buttons — positioned inside the carousel box */
.demo-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(8, 8, 15, 0.75);
    border: 1px solid rgba(74, 158, 255, 0.4);
    color: #ffffff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    backdrop-filter: blur(12px);
}

.demo-carousel-prev {
    left: 16px;
}

.demo-carousel-next {
    right: 16px;
}

.demo-carousel-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
}

/* Carousel Dots */
.demo-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.demo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.25s;
    border: none;
}

.demo-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(74, 158, 255, 0.6);
}

.demo-cta {
    text-align: center;
    padding-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.demo-cta p {
    color: rgba(226, 226, 236, 0.65);
    font-size: 15px;
}

/* ---- Features Section ---- */
.features-section {
    padding: 100px 0;
    background: #08080f;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature-card {
    background: linear-gradient(135deg, rgba(31, 31, 56, 0.9), rgba(22, 22, 42, 0.8));
    border: 1px solid rgba(42, 42, 74, 0.8);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0), transparent);
    transition: background 0.3s;
}

.feature-card:hover {
    border-color: rgba(74, 158, 255, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0.5), transparent);
}

.feature-card-highlight {
    border-color: rgba(74, 158, 255, 0.3);
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.08), rgba(22, 22, 42, 0.9));
}

.feature-card-highlight::before {
    background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0.5), transparent);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(74, 158, 255, 0.12);
    border: 1px solid rgba(74, 158, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
    color: var(--primary);
}

.feature-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.feature-desc {
    font-size: 13.5px;
    color: rgba(226, 226, 236, 0.55);
    line-height: 1.65;
    margin-bottom: 16px;
}

.feature-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}

/* ---- Pricing Section ---- */
.pricing-section {
    padding: 100px 0;
    background: linear-gradient(180deg, #08080f 0%, #0a0a18 100%);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 1100px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pricing-card {
    background: linear-gradient(135deg, rgba(31, 31, 56, 0.95), rgba(22, 22, 42, 0.9));
    border: 1px solid rgba(42, 42, 74, 0.8);
    border-radius: 20px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.pricing-card-recommended {
    border-color: rgba(74, 158, 255, 0.5);
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.08), rgba(31, 31, 56, 0.95));
    box-shadow: 0 0 40px rgba(74, 158, 255, 0.12);
}

.pricing-recommended-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4a9eff, #7c3aed);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 99px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4);
}

.pricing-card-header {
    text-align: center;
}

.pricing-tier {
    font-size: 13px;
    font-weight: 600;
    color: rgba(226, 226, 236, 0.55);
    display: block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-price {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    margin-bottom: 4px;
}

.price-currency {
    font-size: 20px;
    font-weight: 700;
    color: rgba(226, 226, 236, 0.7);
    margin-top: 8px;
}

.price-amount {
    font-size: 52px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -2px;
}

.pricing-period {
    font-size: 12px;
    color: rgba(226, 226, 236, 0.4);
}

.pricing-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: rgba(226, 226, 236, 0.75);
}

.pricing-features li i {
    color: #10b981;
    font-size: 12px;
    flex-shrink: 0;
}

.pricing-cta-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid rgba(74, 158, 255, 0.4);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: rgba(74, 158, 255, 0.1);
    border-color: var(--primary);
}

.btn-primary-solid {
    background: linear-gradient(135deg, #4a9eff, #7c3aed);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(74, 158, 255, 0.35);
}

.btn-primary-solid:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(74, 158, 255, 0.5);
}

.pricing-note {
    text-align: center;
    font-size: 13px;
    color: rgba(226, 226, 236, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ---- Landing Footer ---- */
.landing-footer {
    background: rgba(8, 8, 15, 0.95);
    border-top: 1px solid rgba(42, 42, 74, 0.6);
    padding: 48px 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.footer-brand i {
    color: var(--primary);
}

.footer-tagline {
    font-size: 13px;
    color: rgba(226, 226, 236, 0.4);
    margin-bottom: 8px;
}

.footer-copyright {
    font-size: 12px;
    color: rgba(226, 226, 236, 0.25);
}

/* ---- Hide global header while on landing page ---- */
.landing-mode #app-header {
    display: none;
}

.landing-mode #screens-container {
    height: 100vh;
}

/* ============================================================
   LAYOUT TEMPLATE SELECTOR (HORIZONTAL STRIP)
   ============================================================ */
.layout-template-selector {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px;
    margin: 8px 0 15px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
    min-height: 145px;
    cursor: grab;
    user-select: none;
}

.layout-template-selector.dragging {
    cursor: grabbing;
}

.layout-template-selector.dragging .layout-template-card {
    pointer-events: none;
}

.layout-template-selector::-webkit-scrollbar {
    height: 5px;
}

.layout-template-selector::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 3px;
}

.layout-template-card {
    flex: 0 0 145px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    user-select: none;
}

.layout-template-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.layout-template-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.layout-template-thumb {
    width: 100%;
    height: 75px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.layout-template-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.layout-template-thumb .no-preview {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.layout-template-thumb .no-preview i {
    font-size: 16px;
    color: var(--text-muted);
}

.layout-template-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Zoom Preview Hover Action Button */
.layout-template-zoom-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.layout-template-card:hover .layout-template-zoom-btn {
    opacity: 1;
}

.layout-template-zoom-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Zoom Modal Gallery & Theater Mode - Carousel Layout */
#template-preview-modal {
    z-index: 2000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
}

#template-preview-modal .modal-card {
    max-width: 1000px;
    width: 95%;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: 0 25px 60px var(--shadow);
}

#template-preview-modal .modal-card-body {
    flex: 1;
    overflow: hidden;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
}

.template-preview-modal-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.template-carousel-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    background: var(--bg-app);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#template-carousel-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#template-carousel-active-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: var(--preview-slide-bg, #111116);
    transition: background-color 0.3s ease;
}

#template-carousel-active-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 10;
}

.carousel-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.05);
}

#template-carousel-prev {
    left: 15px;
}

#template-carousel-next {
    right: 15px;
}

#template-carousel-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 10;
}

#template-carousel-thumbs {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    overflow-x: auto;
    padding: 6px;
    width: 100%;
    flex-shrink: 0;
}

.template-thumb-dot {
    width: 72px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    background: var(--preview-slide-bg, #000);
    flex-shrink: 0;
}

.template-thumb-dot:hover {
    opacity: 0.9;
    border-color: var(--border-hover);
}

.template-thumb-dot.active {
    opacity: 1;
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 10px var(--shadow);
}

.template-thumb-dot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- Workspace Stepper Component --- */
.workspace-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    width: 100%;
}

.workspace-stepper .step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.workspace-stepper .step.active {
    opacity: 1;
}

.workspace-stepper .step.completed {
    opacity: 0.9;
}

.workspace-stepper .step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.workspace-stepper .step.active .step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.workspace-stepper .step.completed .step-num {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.workspace-stepper .step-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.workspace-stepper .step.active .step-text {
    color: var(--text-light);
}

.workspace-stepper .step.completed .step-text {
    color: var(--primary);
}

.workspace-stepper .step-line {
    flex: 0 1 80px;
    height: 2px;
    background: var(--border);
    margin: 0 16px;
    transition: all 0.2s ease;
}

.workspace-stepper .step.completed + .step-line {
    background: var(--primary);
}

.workspace-stepper .step-line.completed {
    background: var(--primary);
}

/* Onboarding CTA Buttons & Cards Styling */
.onboarding-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 540px;
    width: 90%;
    margin: auto;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.onboarding-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
}

.onboarding-header p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin: 8px 0;
}

.onboarding-step {
    display: flex;
    gap: 12px;
}

.onboarding-step .step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.onboarding-step h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 2px;
}

.onboarding-step p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.onboarding-cta {
    margin-top: 8px;
}

.onboarding-cta button {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
}

/* --- Integrated Chat Selected Element Tags --- */
.chat-selected-tag {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.chat-selected-tag .tag-close {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-selected-tag .tag-close:hover {
    opacity: 1;
}

/* --- SVG Hover Cursor indicators for editable text --- */
.svg-selectable[id*="text"] {
    cursor: text !important;
}

.svg-selectable text,
.svg-selectable tspan {
    cursor: text !important;
}

#template-preview-modal {
    z-index: 2000;
}

/* ================================================================
   Contextual Popover (appears near clicked SVG element)
   ================================================================ */

#contextual-popover {
    position: fixed;
    z-index: 9999;
    display: none;
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    overflow: hidden;
    animation: popoverIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transform-origin: top left;
}

@keyframes popoverIn {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(-6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popover-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
}

/* --- Mode Select View (first view) --- */
.popover-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popover-title #popover-el-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.popover-title #popover-el-id {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popover-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.btn-popover-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    text-align: center;
}

.btn-popover-action:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-popover-action i {
    font-size: 14px;
    width: 16px;
    flex-shrink: 0;
}

/* --- Direct Edit & AI Annotation Views --- */
.popover-view-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.popover-view-header > span:first-child {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.popover-view-header > span:first-child i {
    color: var(--primary);
    font-size: 13px;
}

.popover-view-hint {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    font-weight: normal !important;
    display: block !important;
}

#popover-direct-textarea,
#popover-ai-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    min-height: 64px;
    font-family: inherit;
    transition: border-color 0.15s;
}

#popover-direct-textarea:focus,
#popover-ai-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.popover-view-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-inline-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-inline-save:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-inline-save:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-inline-cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-inline-cancel:hover {
    background: var(--bg-input);
    color: var(--text-main);
}

/* Dblclick shortcut discovery hint in mode-select popover */
.popover-dblclick-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-top: 1px solid var(--border);
    background: rgba(245, 197, 66, 0.06);
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.4;
    border-radius: 0 0 8px 8px;
    margin: -4px -2px -2px -2px;
}

.popover-dblclick-hint i {
    color: var(--accent);
    font-size: 11px;
    flex-shrink: 0;
    opacity: 0.85;
}

/* ============================================================
   MOBILE RESPONSIVENESS ADAPTATIONS (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* --- App Header & Navigation --- */
    #app-header {
        padding: 0 10px;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 6px;
        padding-bottom: 6px;
    }
    
    #app-title {
        font-size: 14px;
    }
    
    .header-right {
        gap: 6px;
    }
    
    .user-profile-widget {
        gap: 6px;
    }
    
    .user-email-display,
    .guest-badge {
        display: none !important; /* Hide email to save horizontal space */
    }
    
    /* Hide button text to keep it icon-only on very narrow headers */
    .header-btn span,
    #btn-export-pptx span,
    #btn-back-dashboard span {
        display: none !important;
    }
    
    .header-btn i,
    #btn-export-pptx i,
    #btn-back-dashboard i {
        margin: 0 !important;
        font-size: 14px;
    }
    
    /* --- Landing screen --- */
    .landing-nav {
        flex-wrap: wrap;
        padding: 12px 16px;
        height: auto;
        gap: 12px;
        justify-content: space-between;
    }
    
    .landing-nav-links {
        display: none !important; /* Hide links on mobile, users can scroll directly */
    }
    
    .landing-nav-actions {
        width: auto;
    }
    
    .hero-section {
        padding: 60px 16px 40px 16px;
    }
    
    .hero-title {
        font-size: 28px !important;
        line-height: 1.25 !important;
    }
    
    .hero-subtitle {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .hero-stats {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100%;
    }
    
    .hero-stat-divider {
        display: none !important;
    }
    
    .section-heading {
        font-size: 22px !important;
    }
    
    .features-grid,
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* --- Dashboard Screen --- */
    .dashboard-layout {
        padding: 16px;
        overflow-y: auto;
    }
    
    .dashboard-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr !important;
        overflow-y: visible;
        padding: 0;
    }
    
    /* --- Workspace Split Screen Layout --- */
    #app {
        flex-direction: column !important;
        overflow-y: auto;
    }
    
    #panel-center {
        height: 45vh !important;
        min-height: 320px;
        flex: none !important;
        border-bottom: 1px solid var(--border);
    }
    
    #svg-container {
        padding: 12px !important;
    }
    
    #svg-content svg {
        max-height: calc(45vh - 110px) !important;
    }
    
    #panel-right {
        width: 100% !important;
        min-width: unset !important;
        flex: 1 !important;
        height: auto !important;
    }
    
    .workspace-stepper .step-text {
        display: none !important;
    }
    
    .workspace-stepper {
        gap: 6px !important;
        padding: 10px !important;
    }
    
    /* Modal Cards responsive sizing */
    .modal-card {
        width: 95% !important;
        max-width: unset !important;
    }
}







