/* ═══════════════════════════════════════════════════
   Prompt Clipboard Manager v2.5 - Google AI Studio Theme
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ─── Google AI Studio Dark Palette ──────────────── */
:root {
    --bg-primary: #131314;               /* Google AI Studio Main Canvas */
    --bg-secondary: #1e1f20;             /* Surface Container */
    --bg-card: #1e1f20;                  /* Card Surface */
    --bg-card-hover: #28292a;            /* Surface Hover */
    --bg-glass: rgba(30, 31, 32, 0.85);  /* Glass Overlay */
    --bg-sidebar: #18191a;               /* Sidebar Surface */
    --bg-input: #131314;                 /* Inset Field Canvas */
    
    --border-subtle: #28292a;
    --border-accent: #a8c7fa;
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --text-primary: #e3e2e6;             /* Google High Contrast Text */
    --text-secondary: #c4c6d0;           /* Medium Contrast */
    --text-muted: #8e919e;               /* Low Contrast */
    --text-accent: #a8c7fa;              /* Google Blue Accent */
    
    --accent-blue: #a8c7fa;              /* Google Blue Pill */
    --accent-cyan: #7fcfff;
    --accent-purple: #d0bcff;            /* Google Lavender */
    --accent-green: #c4eed0;             /* Google Mint */
    --accent-amber: #ffddb7;
    --accent-red: #f2b8b5;
    --accent-pink: #ffd8e4;
    
    --gradient-accent: linear-gradient(135deg, #a8c7fa, #7fcfff);
    --gradient-success: linear-gradient(135deg, #10b981, #059669);
    --gradient-bg: none;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow-green: 0 0 20px rgba(196, 238, 208, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --sidebar-width: 340px;
    --topbar-height: 52px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Vector SVG Icons ───────────────────────────── */
.svg-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
    flex-shrink: 0;
}

.svg-icon.lg { width: 1.5rem; height: 1.5rem; }
.svg-icon.xl { width: 2.25rem; height: 2.25rem; }
.svg-icon.sm { width: 1rem; height: 1rem; }

/* ─── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #303132;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #444746;
}

/* ═══════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════ */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    background: var(--bg-secondary);
    border: 1px solid #28292a;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-card .logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #004a77;
    color: #c2e7ff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.pin-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.pin-digit {
    width: 50px;
    height: 56px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 600;
    background: var(--bg-input);
    border: 1px solid #444746;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-normal);
    -webkit-text-security: disc;
}

.pin-digit:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(168, 199, 250, 0.2);
}

.login-error {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-bottom: 16px;
    min-height: 20px;
}

.btn-login {
    width: 100%;
    padding: 12px 24px;
    background: #004a77;
    border: none;
    border-radius: 100px;
    color: #c2e7ff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: #005c95;
}

/* ═══════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ─── Dual-Pane Sidebar ─────────────────────────── */
.sidebar-dual-pane {
    display: flex;
    flex-shrink: 0;
    z-index: 10;
    transition: transform var(--transition-slow);
}

/* Pane 1: Projects Rail */
.projects-pane {
    width: 240px;
    background: #131314;
    border-right: 1px solid #28292a;
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    transition: width 0.25s ease, padding 0.25s ease;
}

.projects-pane.collapsed {
    width: 52px;
    padding: 12px 6px;
}

.projects-pane.collapsed .pane-brand h2,
.projects-pane.collapsed .projects-pane-header span,
.projects-pane.collapsed .btn-new-project-sm,
.projects-pane.collapsed .project-name,
.projects-pane.collapsed .project-count-badge,
.projects-pane.collapsed .project-item-actions {
    display: none !important;
}

.projects-pane.collapsed .project-rail-item {
    justify-content: center;
    padding: 8px 0;
}

.projects-pane.collapsed .project-rail-info {
    justify-content: center;
}

.btn-toggle-rail {
    background: #1e1f20;
    border: 1px solid #303132;
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-rail:hover {
    background: #004a77;
    color: #ffffff;
    border-color: #005c95;
}

.projects-pane.collapsed .btn-toggle-rail {
    transform: rotate(180deg);
}

.pane-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.pane-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: #004a77;
    color: #c2e7ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pane-brand h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.projects-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 8px 4px;
    border-bottom: 1px solid #28292a;
    margin-bottom: 8px;
}

.projects-pane-header span {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.btn-new-project-sm {
    background: #1e1f20;
    border: 1px solid #303132;
    color: #a8c7fa;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.btn-new-project-sm:hover {
    background: #004a77;
    color: #ffffff;
    border-color: #005c95;
}

.projects-list-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.project-rail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.project-rail-item:hover {
    background: #1e1f20;
    color: var(--text-primary);
}

.project-rail-item.active {
    background: rgba(168, 199, 250, 0.12);
    border-color: rgba(168, 199, 250, 0.3);
    color: #a8c7fa;
    font-weight: 700;
}

.project-rail-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.project-rail-info .project-icon {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.project-rail-item.active .project-icon {
    color: #a8c7fa;
}

.project-rail-info .project-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.project-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.project-count-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    background: #1e1f20;
    border: 1px solid #28292a;
    border-radius: 100px;
    color: var(--text-muted);
}

.project-rail-item.active .project-count-badge {
    background: rgba(168, 199, 250, 0.2);
    border-color: rgba(168, 199, 250, 0.4);
    color: #a8c7fa;
}

.project-item-actions {
    display: none;
    align-items: center;
    gap: 2px;
}

.project-rail-item:hover .project-item-actions {
    display: flex;
}

.project-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 3px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.project-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.project-action-btn.danger:hover {
    color: #f2b8b5;
    background: rgba(242, 184, 181, 0.2);
}

/* Pane 2: Prompts Files Pane */
.files-pane {
    width: 350px;
    background: var(--bg-sidebar);
    border-right: 1px solid #28292a;
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
}

.files-pane-header {
    margin-bottom: 10px;
    padding: 0 4px;
}

.files-pane-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Project Selector Widget */
.project-selector-card {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #1e1f20;
    border: 1px solid #28292a;
    border-radius: var(--radius-md);
}

.project-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.project-selector-header label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.btn-new-project {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-new-project:hover {
    color: #c2e7ff;
}

.btn-project-action {
    background: #131314;
    border: 1px solid #303132;
    border-radius: 6px;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-project-action:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue);
    background: #28292a;
}

.btn-project-action.danger:hover {
    color: #f2b8b5;
    border-color: #8c1d18;
    background: rgba(242, 184, 181, 0.1);
}

.project-select-dropdown {
    width: 100%;
    padding: 8px 10px;
    background: #131314;
    border: 1px solid #303132;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.project-select-dropdown:focus {
    border-color: var(--accent-blue);
}

/* Stats bar */
.stats-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.stat-chip {
    flex: 1;
    padding: 6px 8px;
    background: #131314;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    border: 1px solid #28292a;
}

.stat-chip .stat-number {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-chip.completed .stat-number { color: #81c995; }
.stat-chip.pending .stat-number { color: #fdd663; }

/* Search & Shuffle Bar */
.search-bar-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 10px;
}

.search-bar-row .search-box {
    flex: 1;
    margin-bottom: 0;
}

.btn-shuffle {
    width: 36px;
    height: 36px;
    background: #131314;
    border: 1px solid #303132;
    border-radius: var(--radius-sm);
    color: #a8c7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-shuffle:hover {
    background: #004a77;
    color: #ffffff;
    border-color: #005c95;
    transform: rotate(90deg);
}

.btn-shuffle.shuffling {
    animation: spinShuffle 0.6s ease-in-out;
}

@keyframes spinShuffle {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.file-item.shuffle-anim {
    animation: shuffleFlip 0.35s ease-in-out forwards;
}

@keyframes shuffleFlip {
    0% { opacity: 0.2; transform: translateY(-8px) scale(0.97); }
    50% { opacity: 0.6; transform: translateY(4px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.search-box {
    position: relative;
    margin-bottom: 10px;
}

.search-box input {
    width: 100%;
    padding: 8px 10px 8px 34px;
    background: #131314;
    border: 1px solid #303132;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent-blue);
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: #131314;
    border-radius: var(--radius-sm);
    padding: 3px;
}

.filter-tab {
    flex: 1;
    padding: 6px 8px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.filter-tab.active {
    background: #28292a;
    color: var(--text-primary);
}

/* File list */
.file-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.file-item:hover {
    background: #28292a;
}

.file-item.active {
    background: #004a77;
    border-color: #005c95;
}

.file-item .file-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #fdd663;
}

.file-item.completed .file-status {
    background: #81c995;
}

.file-item .file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-item .file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.file-item.active .file-name {
    color: #ffffff;
}

.file-item .file-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-item.active .file-meta {
    color: #c2e7ff;
}

.file-item .copied-count-badge {
    color: #81c995;
    font-weight: 700;
}

.file-item.active .copied-count-badge {
    color: #c4eed0;
}

.file-item .file-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.file-item:hover .file-actions,
.file-item.active .file-actions {
    opacity: 1;
}

.file-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-item.active .file-action-btn {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.file-action-btn:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
}

.file-action-btn.danger:hover {
    background: rgba(242, 184, 181, 0.3) !important;
    color: #f2b8b5 !important;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid #28292a;
    display: flex;
    gap: 6px;
}

.btn-sidebar {
    flex: 1;
    padding: 8px 10px;
    background: #1e1f20;
    border: 1px solid #303132;
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-sidebar:hover {
    background: #28292a;
    color: var(--text-primary);
}

.btn-sidebar.danger:hover {
    color: var(--accent-red);
}

/* ─── Main Content ──────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #28292a;
    background: #18191a;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-menu {
    display: none;
    width: 36px;
    height: 36px;
    background: #1e1f20;
    border: 1px solid #303132;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.current-file-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.current-file-info .file-position {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-ring-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-ring {
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: #303132;
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100.53;
    stroke-dashoffset: 100.53;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.progress-text span {
    color: var(--accent-blue);
}

.btn-upload {
    padding: 8px 18px;
    background: #004a77;
    border: none;
    border-radius: 100px;
    color: #c2e7ff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.btn-upload:hover {
    background: #005c95;
}

.btn-logout {
    width: 36px;
    height: 36px;
    background: #1e1f20;
    border: 1px solid #303132;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    color: var(--accent-red);
    background: rgba(242, 184, 181, 0.1);
}

/* ─── Content Area ──────────────────────────────── */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.empty-state .empty-icon {
    width: 72px;
    height: 72px;
    background: #1e1f20;
    border: 1px solid #303132;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 400px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   2-COLUMN SIDE-BY-SIDE PROMPT GRID (Compact Fit)
   ═══════════════════════════════════════════════════ */
.sections-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.section-card {
    background: var(--bg-card);
    border: 1px solid #28292a;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.section-card:hover {
    border-color: #444746;
}

/* 📌 Persistent Copied State Highlight */
.section-card.is-copied {
    border-color: #81c995;
    background: #1e2420;
    box-shadow: 0 0 16px rgba(129, 201, 149, 0.12);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #18191a;
    border-bottom: 1px solid #28292a;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .section-pill {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title .section-pill.image { background: rgba(255, 216, 228, 0.15); color: #ffd8e4; }
.section-title .section-pill.video-before { background: rgba(168, 199, 250, 0.15); color: #a8c7fa; }
.section-title .section-pill.video-after { background: rgba(208, 188, 255, 0.15); color: #d0bcff; }
.section-title .section-pill.narration { background: rgba(255, 221, 183, 0.15); color: #ffddb7; }
.section-title .section-pill.default { background: rgba(127, 207, 255, 0.15); color: #7fcfff; }

/* Copied Badge Tag */
.copied-status-tag {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(129, 201, 149, 0.15);
    border: 1px solid rgba(129, 201, 149, 0.3);
    border-radius: 100px;
    color: #81c995;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.section-card.is-copied .copied-status-tag {
    display: inline-flex;
}

.btn-copy {
    padding: 5px 14px;
    background: #28292a;
    border: 1px solid #303132;
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: #004a77;
    color: #c2e7ff;
    border-color: #005c95;
}

.btn-copy.copied,
.section-card.is-copied .btn-copy {
    background: rgba(129, 201, 149, 0.15);
    border-color: rgba(129, 201, 149, 0.4);
    color: #81c995;
}

.section-content {
    padding: 10px 12px;
}

.section-content .prompt-box {
    background: #131314;
    border: 1px solid #28292a;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.81rem;
    line-height: 1.55;
    color: #e3e2e6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    height: auto;
    overflow-y: auto;
}

.section-card.is-copied .prompt-box {
    border-color: rgba(129, 201, 149, 0.2);
    background: #161a17;
}

/* ─── Action Bar ────────────────────────────────── */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 0 0;
    border-top: 1px solid #28292a;
    flex-shrink: 0;
    margin-top: 4px;
}

.btn-complete {
    padding: 8px 20px;
    background: #004a77;
    border: none;
    border-radius: 100px;
    color: #c2e7ff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
    color: #c2e7ff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-complete:hover {
    background: #005c95;
}

.btn-complete.is-completed {
    background: #1e2420;
    border: 1px solid #81c995;
    color: #81c995;
}

.btn-nav {
    padding: 8px 16px;
    background: #1e1f20;
    border: 1px solid #303132;
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-nav:hover {
    background: #28292a;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════
   MODALS & TOASTS
   ═══════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.show { display: flex; }

.modal-card {
    width: 100%;
    max-width: 500px;
    background: #1e1f20;
    border: 1px solid #28292a;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 14px;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-modal-close {
    width: 32px;
    height: 32px;
    background: #131314;
    border: 1px solid #303132;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body { padding: 0 24px 24px; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background: #131314;
    border: 1px solid #303132;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
}

.form-control:focus { border-color: var(--accent-blue); }

.drop-zone {
    border: 2px dashed #303132;
    border-radius: var(--radius-lg);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    background: #131314;
}

.drop-zone:hover { border-color: var(--accent-blue); }

.drop-zone .drop-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: #004a77;
    color: #c2e7ff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone h4 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.drop-zone p { font-size: 0.82rem; color: var(--text-muted); }
.drop-zone .browse-link { color: var(--accent-blue); text-decoration: underline; cursor: pointer; }

.upload-progress { margin-top: 16px; display: none; }
.upload-progress.show { display: block; }

.progress-bar-track {
    width: 100%; height: 6px; background: #131314; border-radius: 3px; overflow: hidden; margin-bottom: 10px;
}
.progress-bar-fill {
    height: 100%; background: #004a77; width: 0%; transition: width 0.3s ease;
}
.upload-status { font-size: 0.82rem; color: var(--text-secondary); }

.upload-result {
    margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.82rem; display: none;
}
.upload-result.success { display: block; background: rgba(129, 201, 149, 0.15); border: 1px solid rgba(129, 201, 149, 0.3); color: #81c995; }
.upload-result.has-errors { display: block; background: rgba(253, 214, 99, 0.15); border: 1px solid rgba(253, 214, 99, 0.3); color: #fdd663; }

/* Toast */
.toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px;
}
.toast {
    padding: 12px 18px; background: #1e1f20; border: 1px solid #303132; border-radius: 100px; color: var(--text-primary); font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-md);
}
.toast.success { border-color: #81c995; color: #81c995; }
.toast.error { border-color: #f2b8b5; color: #f2b8b5; }

.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.btn-confirm-cancel { padding: 8px 16px; background: #131314; border: 1px solid #303132; border-radius: 100px; color: var(--text-secondary); font-family: inherit; font-size: 0.82rem; cursor: pointer; }
.btn-confirm-ok { padding: 8px 16px; background: #8c1d18; border: none; border-radius: 100px; color: #f2b8b5; font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }

@media (max-width: 900px) {
    .sections-grid { grid-template-columns: 1fr; }
    .sidebar-dual-pane { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 50; }
    .sidebar-dual-pane.open { transform: translateX(0); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 40; }
    .sidebar-overlay.show { display: block; }
    .btn-menu { display: flex; }
    .content-area { padding: 16px; }
}

#fileInput { display: none; }

/* ═══════════════════════════════════════════════════
   MULTI-USER REAL-TIME PRESENCE & LOCK STYLES
   ═══════════════════════════════════════════════════ */
.in-use-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 100px;
    color: #f59e0b;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    animation: pulseLock 2s infinite ease-in-out;
}

@keyframes pulseLock {
    0%, 100% { opacity: 1; border-color: rgba(245, 158, 11, 0.35); }
    50% { opacity: 0.7; border-color: rgba(245, 158, 11, 0.8); }
}

.file-item.is-locked {
    border-color: rgba(245, 158, 11, 0.25);
}

.user-session-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #1e1f20;
    border: 1px solid #303132;
    border-radius: 100px;
    color: #a8c7fa;
    font-size: 0.75rem;
    font-weight: 600;
}

.active-users-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(129, 201, 149, 0.12);
    border: 1px solid rgba(129, 201, 149, 0.3);
    border-radius: 100px;
    color: #81c995;
    font-size: 0.75rem;
    font-weight: 700;
}

.active-users-pill .live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #81c995;
    box-shadow: 0 0 8px #81c995;
    animation: livePulse 1.8s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.active-user-warning-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.in-use-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 4px;
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 8px;
}
