/**
 * AI Blog Manager - Editorial Design System
 * Aesthetic: Minimal, Calm, Intelligent, Content-Focused (Linear / Notion / Vercel vibe)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Base Neutral Canvas & Surfaces */
    --bg-canvas: #F7F8FA;
    --surface: #FFFFFF;
    --surface-secondary: #F4F5F7;
    --surface-tertiary: #ECEEF2;
    --surface-hover: #F9FAFB;

    /* Hairline Crisp Borders */
    --border: #E4E7EC;
    --border-subtle: #F2F4F7;
    --border-strong: #D0D5DD;
    --border-focus: #18181B;

    /* High-Readability Typography */
    --text-primary: #18181B;
    --text-secondary: #475467;
    --text-muted: #667085;
    --text-subtle: #98A2B3;

    /* Refined Primary Accent (Sophisticated Near-Black / Slate) */
    --primary: #18181B;
    --primary-hover: #27272A;
    --primary-active: #09090B;
    --primary-fg: #FFFFFF;
    --primary-glow: rgba(24, 24, 27, 0.08);

    /* Subtle Indigo Accent (Used sparingly for AI magic tags & focus rings) */
    --accent-indigo: #4F46E5;
    --accent-indigo-light: #EEF2FF;
    --accent-indigo-border: #C7D2FE;
    --accent-indigo-hover: #4338CA;

    /* Semantic States (Pastel Pills & Badges) */
    --success-bg: #ECFDF3;
    --success-text: #027A48;
    --success-border: #A6F4C5;

    --warning-bg: #FFFAEB;
    --warning-text: #B54708;
    --warning-border: #FEDF89;

    --danger-bg: #FEF3F2;
    --danger-text: #B42318;
    --danger-border: #FECDCA;

    --info-bg: #F0F9FF;
    --info-text: #026AA2;
    --info-border: #B9E6FE;

    /* Shell Dimensions */
    --sidebar-width: 240px;
    --navbar-height: 56px;

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;

    /* Realistic Soft Shadows (No muddy heavy drop shadows) */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.03);
    --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.06), 0 2px 4px -2px rgba(16, 24, 40, 0.03);
    --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
    --shadow-popover: 0 16px 32px -8px rgba(16, 24, 40, 0.12), 0 4px 8px -2px rgba(16, 24, 40, 0.04);

    /* Legacy CSS Variable Compatibility */
    --primary-color: #18181B;
    --body-bg: var(--bg-canvas);
    --card-bg: var(--surface);
    --card-border: var(--border);
    --text-main: var(--text-primary);
    --success-color: var(--success-text);
    --success-light: var(--success-bg);
    --warning-color: var(--warning-text);
    --warning-light: var(--warning-bg);
    --danger-color: var(--danger-text);
    --danger-light: var(--danger-bg);
}

/* Base Document Reset */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-size: 0.875rem; /* 14px */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* Clean Typography Scale */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 0;
}

h1, .h1 { font-size: 1.75rem; } /* 28px */
h2, .h2 { font-size: 1.35rem; } /* 21.6px */
h3, .h3 { font-size: 1.15rem; } /* 18.4px */
h4, .h4 { font-size: 1rem; }    /* 16px */
h5, .h5 { font-size: 0.9rem; }  /* 14.4px */

p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-indigo);
}

::selection {
    background: #E4E7EC;
    color: #18181B;
}

/* Minimal Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #D0D5DD;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #98A2B3;
}

/* ==========================================================================
   Shell Layout (Sidebar + Main Canvas + Top Navbar)
   ========================================================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-canvas);
    transition: margin-left 0.2s ease;
}

.main-content {
    flex: 1;
    padding: 1.75rem 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Clean Minimal Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: width 0.2s ease;
}

.sidebar-brand {
    height: var(--navbar-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.sidebar-brand:hover {
    color: var(--text-primary);
}

.sidebar-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-brand-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-brand-badge {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: var(--surface-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0.65rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-header {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 0.85rem 0.65rem 0.35rem 0.65rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
    margin-bottom: 2px;
}

.sidebar-nav .nav-link i {
    font-size: 1rem;
    color: var(--text-muted);
    transition: color 0.12s ease;
    width: 18px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--surface-secondary);
}

.sidebar-nav .nav-link:hover i {
    color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
    color: var(--text-primary);
    background-color: var(--surface-secondary);
    font-weight: 600;
}

.sidebar-nav .nav-link.active i {
    color: var(--text-primary);
}

/* Sidebar Footer User Card */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
    background-color: var(--surface);
}

.user-avatar-wrap {
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.user-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10B981;
    border: 2px solid var(--surface);
}

.user-info .user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-info .user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-sidebar-logout {
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-sidebar-logout:hover {
    color: var(--danger-text);
    background: var(--danger-bg);
}

/* Sticky Minimal Top Navbar */
.top-navbar {
    height: var(--navbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.top-navbar h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.user-avatar-sm {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-tertiary);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

/* ==========================================================================
   Cards & Surface Containers
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-subtle);
    padding: 0.75rem 1.25rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Minimal Stat Cards */
.stat-card {
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background: var(--surface-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1.4;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.btn:active {
    transform: scale(0.98);
}

/* Primary Button: Clean Solid Near-Black */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-fg);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #FFFFFF;
}

/* Secondary Button: Clean White with 1px border */
.btn-secondary, .btn-light, .btn-outline-secondary {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover, .btn-light:hover, .btn-outline-secondary:hover {
    background-color: var(--surface-secondary);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Outline Primary */
.btn-outline-primary {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-outline-primary:hover {
    background-color: var(--surface-secondary);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Ghost Button */
.btn-ghost {
    background-color: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background-color: var(--surface-secondary);
    color: var(--text-primary);
}

/* AI Action Button (Calm, Elegant, No Rainbows) */
.btn-ai-magic {
    background-color: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.btn-ai-magic:hover {
    background-color: var(--primary-hover);
    color: #FFFFFF;
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
}

.btn-lg {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--primary-glow);
    outline: none;
}

.form-label {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-text {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-control::placeholder {
    color: var(--text-subtle);
    font-size: 0.85rem;
}

.input-group-text {
    background-color: var(--surface-secondary);
    border-color: var(--border-strong);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* Segmented Nav Pills (macOS / Notion style) */
.nav-pills {
    background: var(--surface-secondary);
    padding: 3px;
    border-radius: var(--radius-md);
    display: inline-flex;
    border: 1px solid var(--border);
    gap: 3px;
}

.nav-pills .nav-link {
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
}

.nav-pills .nav-link:hover {
    color: var(--text-primary);
}

.nav-pills .nav-link.active {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

/* Keyword & Pill Badges */
.badge-keyword {
    background-color: var(--surface-secondary);
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    transition: all 0.12s ease;
}

.badge-keyword:hover {
    background-color: var(--surface-tertiary);
}

.badge-keyword .remove-btn {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1;
}

.badge-keyword .remove-btn:hover {
    color: var(--danger-text);
}

/* Semantic Badges */
.badge {
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
}

.badge-published, .badge.bg-success {
    background-color: var(--success-bg) !important;
    color: var(--success-text) !important;
    border: 1px solid var(--success-border);
}

.badge-draft, .badge.bg-secondary {
    background-color: var(--surface-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border);
}

.badge-scheduled, .badge.bg-warning {
    background-color: var(--warning-bg) !important;
    color: var(--warning-text) !important;
    border: 1px solid var(--warning-border);
}

.badge-danger, .badge.bg-danger {
    background-color: var(--danger-bg) !important;
    color: var(--danger-text) !important;
    border: 1px solid var(--danger-border);
}

/* ==========================================================================
   Tables & Data Presentation
   ========================================================================== */
.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table thead th {
    background-color: var(--surface-hover);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table tbody tr:hover {
    background-color: var(--surface-hover);
}

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

/* ==========================================================================
   Modals & Glassmorphic Backdrop
   ========================================================================== */
.modal-backdrop.show {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(15, 23, 42, 0.45);
}

.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-popover);
    background: var(--surface);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.4rem;
    background: var(--surface);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.4rem;
}

.modal-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 0.85rem 1.4rem;
    background: var(--surface-hover);
}

/* ==========================================================================
   AI Generation Loading Overlay (Calm, Intelligent, Distraction-Free)
   ========================================================================== */
.generation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(247, 248, 250, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.generation-box {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-popover);
    border: 1px solid var(--border);
    text-align: center;
}

.step-checklist {
    text-align: left;
    margin: 1.5rem 0;
    list-style: none;
    padding: 0;
}

.step-checklist li {
    padding: 0.55rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.step-checklist li.active {
    color: var(--text-primary);
    font-weight: 600;
}

.step-checklist li.done {
    color: var(--success-text);
}

.step-checklist li i {
    font-size: 1rem;
}

/* ==========================================================================
   Blog Editor & Writing Workspace
   ========================================================================== */
.editor-title-input {
    font-size: 1.65rem;
    font-weight: 700;
    border: 1px solid transparent;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    transition: all 0.15s ease;
    background: transparent;
}

.editor-title-input:hover, .editor-title-input:focus {
    border-color: var(--border);
    background-color: var(--surface);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.rich-editor-toolbar {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-bottom: none;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    padding: 0.45rem 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.rich-editor-toolbar .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rich-editor-toolbar .btn:hover {
    color: var(--text-primary);
    background-color: var(--surface-secondary);
}

.rich-editor-content {
    min-height: 480px;
    outline: none;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.75;
    color: #27272A;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--surface);
}

.rich-editor-content:focus {
    border-color: var(--border-strong);
}

/* Featured Image Banner in Editor */
.featured-image-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 200px;
    max-height: 380px;
    background-color: #0b0f19;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-image-wrapper img {
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.featured-image-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(24, 24, 27, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    display: flex;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* SEO Score Gauge */
.seo-gauge {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto;
}

.seo-gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.seo-gauge-text .score-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.seo-gauge-text .score-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

/* SERP Google Snippet Preview */
.serp-preview {
    background-color: #FFFFFF;
    border: 1px solid #DFE1E5;
    border-radius: 8px;
    padding: 1rem;
    font-family: Arial, sans-serif;
    box-shadow: var(--shadow-xs);
}

.serp-url {
    font-size: 12px;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.serp-title {
    font-size: 16px;
    color: #1A0DAB;
    line-height: 1.3;
    font-weight: 400;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.serp-desc {
    font-size: 13px;
    color: #4D5156;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Media Library Grid & Selection Bar
   ========================================================================== */
.media-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.media-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.media-card-img-wrap {
    position: relative;
    height: 170px;
    background-color: var(--surface-secondary);
    overflow: hidden;
}

.media-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.media-card:hover .media-card-img-wrap img {
    transform: scale(1.02);
}

.media-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    border: 1px solid var(--border-strong);
}

/* Sticky Bulk Action Floating Bar */
.sticky-selection-bar {
    position: sticky;
    top: calc(var(--navbar-height) + 12px);
    z-index: 85;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Idea Bank Cards
   ========================================================================== */
.idea-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 1.15rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.idea-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Empty States
   ========================================================================== */
.empty-state-box {
    text-align: center;
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem auto;
}

/* Toast Container */
.toast-container {
    z-index: 10000;
}

/* Responsive Shell Breakpoints */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-popover);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .top-navbar {
        padding: 0 1rem;
    }
    .main-content {
        padding: 1.25rem 1rem;
    }
}
