/* ==========================================================================
   Ultra Unbreakable Social Media Hub v2 — Modern Dark Theme Styles
   ========================================================================== */

:root {
    --bg-primary: #0a0a1a;
    --bg-surface: #16213e;
    --bg-surface-light: #1a2744;
    --bg-card: #1f2d50;
    --border-color: #2d3436;
    --border-accent: rgba(0, 206, 201, 0.3);
    
    --text-main: #ffffff;
    --text-secondary: #b2bec3;
    --text-muted: #636e72;
    
    --color-primary: #1a1a2e;
    --color-secondary: #6c5ce7;
    --color-accent: #00cec9;
    --color-success: #00b894;
    --color-warning: #fdcb6e;
    --color-error: #e17055;
    --color-blue: #0984e3;

    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-neon: 0 0 15px rgba(0, 206, 201, 0.4);

    --sidebar-width: 280px;
    --header-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   Main Layout Structure
   ========================================================================== */

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    box-shadow: var(--shadow-neon);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation Tabs */
.top-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.header-item-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-accent);
    padding: 0 10px 0 8px;
    border-right: 1px solid var(--border-color);
    margin-right: 2px;
    white-space: nowrap;
}

.nav-tab {
    padding: 8px 18px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    background: var(--color-accent);
    color: var(--color-primary);
    font-weight: 700;
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.4);
}

.nav-tab.admin-tab {
    border-left: 1px solid var(--border-color);
}

/* User & Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-auth {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--color-accent);
    background: transparent;
    color: var(--color-accent);
}

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

.admin-badge {
    background: rgba(108, 92, 231, 0.2);
    color: var(--color-secondary);
    border: 1px solid var(--color-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Layout Main Body */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ==========================================================================
   Persistent Left Sidebar
   ========================================================================== */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    gap: 20px;
    flex-shrink: 0;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-clear-filters {
    background: rgba(235, 77, 75, 0.15);
    border: 1px solid rgba(235, 77, 75, 0.4);
    color: #ff6b6b;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #ff6b6b;
    color: #ffffff;
    border-color: #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.cat-count {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 6px;
    border-radius: 10px;
}

/* Global Audio Toggle Button */
.btn-global-audio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-global-audio:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-global-audio.unmuted {
    background: rgba(0, 210, 255, 0.2);
    border-color: #00d2ff;
    color: #00d2ff;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

/* Card Audio Toggle Button */
.card-audio-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.85;
}

.card-audio-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(108, 92, 231, 0.9);
    border-color: var(--color-accent);
}

.card-audio-toggle.unmuted {
    background: var(--color-accent);
    color: #ffffff;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* Taxonomy Toggle Buttons & Expandable Tree */
.filter-list,
.taxonomy-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.cat-expand-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cat-expand-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--color-accent);
}

.cat-expand-btn.expanded {
    transform: rotate(90deg);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.subcat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 30px;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.subcat-list.collapsed {
    display: none;
}

/* Taxonomy Toggle Button */
.taxonomy-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 1.5px solid var(--btn-color, var(--color-accent));
    background: rgba(255, 255, 255, 0.03);
    color: var(--btn-color, var(--color-accent));
    line-height: 1;
}

.taxonomy-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.taxonomy-toggle-btn.active {
    background: var(--btn-color, var(--color-accent));
    color: #ffffff !important;
    box-shadow: 0 2px 12px var(--btn-glow, rgba(108, 92, 231, 0.4));
    border-color: var(--btn-color, var(--color-accent));
}

.taxonomy-toggle-btn.partial {
    background: rgba(108, 92, 231, 0.15);
    border-style: dashed;
    color: var(--btn-color, var(--color-accent));
}

/* Contrast fix for yellow/gold buttons */
.taxonomy-toggle-btn[data-color="#fdcb6e"].active {
    color: #1e272e !important;
}

/* Subcategory pill slightly smaller */
.taxonomy-toggle-btn.subcat-btn {
    padding: 5px 11px;
    font-size: 11.5px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.filter-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.filter-item input[type="checkbox"] {
    accent-color: var(--color-accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Hashtag Cloud */
.hashtag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    padding: 4px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-pill:hover, .tag-pill.active {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(0, 206, 201, 0.1);
}

/* ==========================================================================
   Content Workspace & Views
   ========================================================================== */

.content-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.view-container {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.view-container.active {
    display: flex;
    flex-direction: column;
}

/* Grid View Bar */
.grid-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.view-stats {
    color: var(--text-secondary);
    font-size: 13px;
}

.card-size-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-surface);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.size-btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.size-btn.active {
    background: var(--bg-surface-light);
    color: var(--color-accent);
}

/* Content Grid */
.content-grid {
    display: grid;
    gap: 20px;
}

.content-grid.small {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.content-grid.medium {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.content-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* Grid Card */
.grid-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.grid-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

/* Thumbnail & Hover Video Container */
.card-media-wrapper {
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    position: relative;
    overflow: hidden;
}

.card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-media-wrapper:hover .card-video {
    opacity: 1;
}

.card-media-wrapper:hover .card-thumbnail {
    opacity: 0;
}

.play-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cat-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.card-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   5-Panel Gallery View
   ========================================================================== */

.gallery-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.gallery-main-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    align-items: start;
}

.gallery-workspace-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gallery-top-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    padding: 10px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.gallery-nav-btn {
    background: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-nav-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* 3-Panel Top Row */
.gallery-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.gallery-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Video Player Panel */
.gallery-video-container {
    width: 100%;
    aspect-ratio: 9 / 16;
    min-height: 480px;
    max-height: 540px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.gallery-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Takeaways Panel */
.takeaway-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    min-height: 480px;
    max-height: 540px;
    overflow-y: auto;
}

.takeaway-item {
    display: flex;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-main);
    background: var(--bg-primary);
    padding: 10px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
}

/* Image / Micro Video Panel */
.gallery-image-box {
    width: 100%;
    aspect-ratio: 9 / 16;
    min-height: 480px;
    max-height: 540px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.ai-prompt-preview {
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-ai-gen {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    border: none;
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* Script Panel (Middle) */
.gallery-script-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.script-text-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    max-height: 160px;
    overflow-y: auto;
    font-family: var(--font-body);
}

/* Right Vertical Publishing Sidebar Panel 5 */
.gallery-publish-sidebar {
    background: var(--bg-surface-light);
    border: 1px solid var(--color-secondary);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    box-shadow: var(--shadow-md);
}

.platform-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.platform-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.platform-card.configured:hover {
    border-color: var(--color-accent);
    background: rgba(0, 206, 201, 0.08);
}

.platform-card.selected {
    border-color: var(--color-accent);
    background: rgba(0, 206, 201, 0.15);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.25);
}

.platform-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.platform-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.platform-status-badge.active {
    background: rgba(0, 206, 201, 0.2);
    color: var(--color-accent);
}

.platform-status-badge.locked {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.platform-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.published { background: var(--color-success); }
.status-indicator.scheduled { background: var(--color-warning); }

/* ==========================================================================
   Ingestion Workflow UI (Admin Tab)
   ========================================================================== */

.ingest-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ingest-stepper {
    display: flex;
    justify-content: space-between;
    background: var(--bg-surface);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-muted);
}

.step-item.active {
    color: var(--color-accent);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.step-item.active .step-num {
    background: var(--color-accent);
    color: var(--color-primary);
}

.ingest-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-primary);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    box-shadow: var(--shadow-neon);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 12px;
}

.preview-table th, .preview-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.preview-table th {
    background: var(--bg-primary);
    color: var(--color-accent);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-lg);
}

.input-field {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14px;
}

.input-field:focus {
    border-color: var(--color-accent);
}

/* ==========================================================================
   View Type Switcher (Grid / List Toggle)
   ========================================================================== */
.view-type-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
}

.view-type-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-type-btn.active {
    background: var(--color-accent);
    color: var(--bg-primary);
    font-weight: 700;
}

.view-type-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   List View Components
   ========================================================================== */
.content-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    width: 100%;
    overflow-y: auto;
}

.list-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    transition: all 0.2s ease;
    cursor: grab;
}

.list-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.list-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--color-accent);
}

.list-card-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    cursor: pointer;
}

.list-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2;
}

.list-card-video.playing {
    opacity: 1 !important;
}

.list-card-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.list-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.list-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.list-card-title:hover {
    color: var(--color-accent);
}

.list-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(0, 206, 201, 0.15);
    color: var(--color-accent);
    white-space: nowrap;
}

.list-card-script-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-card-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.list-hashtag-pill {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-accent);
    background: rgba(0, 206, 201, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.list-hashtag-pill:hover {
    background: var(--color-accent);
    color: var(--bg-primary);
}

.list-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.list-scheduled-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    background: rgba(0, 206, 201, 0.1);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-md);
    padding: 6px 10px;
    font-size: 11px;
    text-align: right;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-scheduled-stack:hover {
    background: rgba(0, 206, 201, 0.2);
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.35);
}

.scheduled-stack-date {
    font-weight: 800;
    color: var(--color-accent);
}

.scheduled-stack-time {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-main);
}

.scheduled-stack-platforms {
    font-size: 10px;
    letter-spacing: 1px;
    margin-top: 1px;
}

.btn-list-action {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-list-action:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ==========================================================================
   Calendar Split View (50/50 Layout & Drag & Drop)
   ========================================================================== */
.calendar-split-container {
    display: flex;
    height: calc(100vh - var(--header-height));
    width: 100%;
    overflow: hidden;
}

.calendar-split-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.calendar-split-column.left {
    border-right: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.calendar-split-column.right {
    background: var(--bg-surface);
}

.calendar-left-header, .calendar-right-header {
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-left-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.calendar-days-scroll-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-day-slot {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.calendar-day-slot.today {
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.15);
}

.calendar-day-slot.drag-over {
    border: 2px dashed var(--color-accent);
    background: rgba(0, 206, 201, 0.08);
}

.calendar-day-info {
    width: 100px;
    flex-shrink: 0;
}

.day-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.day-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.today-badge {
    font-size: 9px;
    font-weight: 800;
    background: var(--color-accent);
    color: var(--bg-primary);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    margin-left: 4px;
}

.calendar-slot-target {
    flex: 1;
}

.empty-drop-placeholder {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.2s ease;
}

.calendar-day-slot.drag-over .empty-drop-placeholder {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.scheduled-post-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

.scheduled-banner-card {
    background: rgba(0, 206, 201, 0.1);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-top: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.scheduled-banner-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 14px rgba(0, 206, 201, 0.35);
}

.scheduled-badge-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.scheduled-badge-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scheduled-badge-details {
    flex: 1;
    min-width: 0;
}

.scheduled-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheduled-time {
    font-size: 11px;
    color: var(--color-accent);
}

.btn-remove-schedule {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}

.btn-remove-schedule:hover {
    color: #ff6b6b;
}

/* ==========================================================================
   Published Analytics View
   ========================================================================== */
.published-analytics-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    width: 100%;
    overflow: hidden;
}

.published-analytics-header {
    padding: 16px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.published-rows-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.published-row-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    transition: all 0.2s ease;
}

.published-row-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
}

.published-row-platform {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 120px;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-main);
}

.platform-badge-icon {
    font-size: 18px;
}

.published-row-media {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: var(--bg-primary);
}

.published-row-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.published-row-details {
    flex: 1;
    min-width: 0;
}

.published-row-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.published-row-title:hover {
    color: var(--color-accent);
}

.published-row-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.published-row-analytics {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.analytic-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    min-width: 80px;
}

.analytic-icon {
    font-size: 12px;
}

.analytic-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.analytic-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--color-accent);
}

/* ==========================================================================
   Per-Post Hashtag Picker Styles
   ========================================================================== */
.per-post-hashtag-picker {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-top: 4px;
}

.hashtag-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
}

.hashtag-edit-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hashtag-edit-chip:hover {
    border-color: var(--color-accent);
    color: var(--text-main);
}

.hashtag-edit-chip.selected {
    background: var(--color-accent);
    color: var(--bg-primary);
    border-color: var(--color-accent);
    font-weight: 700;
}

/* ==========================================================================
   7-Column Month Grid Calendar Styles
   ========================================================================== */
#calendar-right-workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.month-grid-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto !important;
    max-height: calc(100vh - var(--header-height) - 60px);
}

.weekday-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.weekday-cell {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--color-accent);
    text-transform: uppercase;
    padding: 4px;
}

.month-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 110px !important;
    gap: 6px;
    align-content: start;
}

/* Compact Grid View for Left Split Column (Fixed height cell & 3 lines of title text) */
.calendar-left-content-area.content-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    grid-auto-rows: max-content !important;
    align-content: start !important;
    gap: 12px !important;
    padding: 14px !important;
}

.calendar-left-content-area .grid-card {
    padding: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    background: var(--bg-card) !important;
    border-radius: var(--radius-md) !important;
    transition: all 0.2s ease !important;
}

.calendar-left-content-area .card-media-wrapper {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: 125px !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
}

.calendar-left-content-area .card-thumbnail {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.calendar-left-content-area .card-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    text-align: center !important;
    margin-top: 6px !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    max-height: 42px !important;
}

.calendar-left-content-area .card-desc,
.calendar-left-content-area .play-badge,
.calendar-left-content-area .cat-badge {
    display: none !important;
}

/* ==========================================================================
   Apple Calendar Style Continuous Vertical Scroll & Schedule Modal
   ========================================================================== */
.apple-continuous-scroll-wrapper {
    flex: 1;
    overflow-y: auto !important;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    height: 100%;
}

.apple-month-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.apple-month-title-header {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-accent);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 5;
}

.month-day-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    height: 110px !important;
    max-height: 110px !important;
    box-sizing: border-box !important;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background 0.2s ease, outline 0.2s ease;
    overflow: hidden !important;
}

.month-day-box.blank {
    background: transparent;
    border-color: transparent;
}

.month-day-box.today {
    border-color: var(--color-accent);
    box-shadow: inset 0 0 8px rgba(0, 206, 201, 0.2);
}

.month-day-box.drag-over {
    outline: 2px dashed var(--color-accent) !important;
    outline-offset: -2px !important;
    background: rgba(0, 206, 201, 0.15) !important;
}

.month-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
    flex-shrink: 0;
}

.month-day-number {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
}

.month-day-time {
    font-size: 9px;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}

.today-dot {
    color: var(--color-accent);
    margin-left: 2px;
}

.month-day-target {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    overflow: hidden;
}

.month-empty-placeholder {
    font-size: 16px;
    color: var(--text-muted);
    opacity: 0.3;
}

.month-scheduled-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-height: 80px;
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    padding: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
}

.month-scheduled-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.4);
}

.month-card-thumb {
    width: 100%;
    height: 42px;
    max-height: 42px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.month-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.month-card-title {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.month-card-platforms {
    font-size: 9px;
    letter-spacing: 1px;
}

.btn-remove-month-slot {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.75);
    color: #ff6b6b;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

/* ==========================================================================
   Auto-Scroll Highlight Pulse
   ========================================================================== */
.highlight-pulse {
    animation: pulseGlow 1.2s ease-in-out 2 forwards;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 rgba(0, 206, 201, 0.8);
        border-color: var(--color-accent);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 206, 201, 0.9);
        border-color: var(--color-accent);
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 206, 201, 0);
    }
}


