/**
 * Admin Dashboard Styles
 * Mobile-first design for iPhone SE (375x667)
 *
 * Design constraints:
 * - 375px width, single column
 * - 44x44px minimum touch targets (Apple HIG)
 * - 16px minimum input font (prevents iOS zoom)
 * - Generous padding for touch
 */

/* ========================================
   CSS Variables
   ======================================== */

:root {
    /* Colors (matching portfolio) */
    --forest-900: #0f2918;
    --forest-800: #1a3a1a;
    --forest-700: #23613d;
    --forest-600: #2d7a4d;
    --terracotta: #b4673c;
    --terracotta-light: #c19c41;
    --terracotta-dark: #9e4f33;
    --sand: #D5C994;
    --sand-light: #e8dfc0;

    /* Semantic colors */
    --bg-primary: var(--forest-900);
    --bg-secondary: var(--forest-800);
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85); /* WCAG AA: ~5:1 contrast ratio */
    --text-muted: rgba(255, 255, 255, 0.7); /* WCAG AA for large text: ~3.5:1 */
    --accent: var(--sand);
    --accent-hover: var(--sand-light);
    --border: rgba(255, 255, 255, 0.1);
    --error: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Touch target minimum */
    --touch-min: 44px;

    /* Typography */
    --font-family: 'Outfit', system-ui, sans-serif;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--sand-light); /* Cream background, tabs provide color */
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ========================================
   Screen Layout
   ======================================== */

.screen {
    min-height: 100vh;
    min-height: 100dvh;
}

.hidden {
    display: none !important;
}

/* ========================================
   Auth Screen
   ======================================== */

#auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.auth-container {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.auth-logo {
    width: 80px;
    height: auto;
    margin-bottom: var(--space-lg);
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 300;
    margin: 0 0 var(--space-md);
}

.auth-status {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0;
}

/* Password Form */
.password-form {
    margin-top: var(--space-xl);
    text-align: left;
}

.password-label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.password-input {
    width: 100%;
    height: var(--touch-min);
    padding: 0 var(--space-md);
    font-size: var(--font-size-base); /* 16px prevents iOS zoom */
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast);
}

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

.password-input::placeholder {
    color: var(--text-muted);
}

.password-submit {
    width: 100%;
    height: var(--touch-min);
    margin-top: var(--space-md);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--forest-900);
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.password-submit:hover,
.password-submit:focus {
    background: var(--accent-hover);
}

.password-submit:active {
    transform: scale(0.98);
}

.password-error {
    margin-top: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--error);
    text-align: center;
}

/* ========================================
   App Header
   ======================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--sand-light);
    border-bottom: none;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-logo {
    height: 32px;
    width: auto;
}

.header-title {
    font-size: var(--font-size-base);
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--forest-900);
}

/* Hide title on very small screens, show logo only */
@media (max-width: 400px) {
    .header-title {
        display: none;
    }
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
}

.header-btn {
    height: var(--touch-min); /* 44px - Apple HIG minimum */
    padding: 0 var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.025em;
    border: none;
    border-radius: 9999px; /* rounded-full like CTA */
    cursor: pointer;
    transition: all 300ms ease;
}

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

/* Disabled state for header buttons */
.header-btn.btn-disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

/* Publish - terracotta */
.header-btn.primary {
    color: var(--forest-900);
    background: var(--terracotta);
}

/* Undo - cream */
.header-btn.undo {
    color: var(--forest-900);
    background: var(--sand-light);
}

/* Preview - lighter green */
.header-btn.preview {
    color: white;
    background: var(--forest-600);
}

/* Publish button states */
.header-btn.publishing {
    opacity: 0.7;
    cursor: wait;
}

.header-btn.success {
    background: var(--success);
    color: white;
}

.header-btn.error {
    background: var(--error);
    color: white;
}

.btn-icon {
    font-size: var(--font-size-lg);
}

/* Header SVG Icons */
.btn-icon-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ========================================
   Tab Navigation
   ======================================== */

.tab-nav {
    display: flex;
    position: relative;
}

/* Gradient fill to the right of tabs (desktop only) */
.tab-nav::after {
    content: '';
    flex: 1;
    background: linear-gradient(to right, var(--forest-600) 0%, var(--terracotta) 100%);
}

/* On mobile, tabs fill full width - no gradient needed */
@media (max-width: 480px) {
    .tab-nav::after {
        display: none;
    }
}

.tab-btn {
    position: relative;
    flex: 0 0 80px; /* Fixed width on desktop */
    height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--sand-light); /* Matches social icons */
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* Tab background matches its panel color */
.tab-btn[data-tab="mail"] { background: var(--terracotta); }
.tab-btn[data-tab="edit"] { background: var(--terracotta-dark); }
.tab-btn[data-tab="search"] { background: var(--forest-600); }
.tab-btn[data-tab="analytics"] { background: var(--forest-900); }

/* On mobile (375px), tabs fill full width equally */
@media (max-width: 480px) {
    .tab-btn {
        flex: 1;
    }
}

.tab-btn:hover {
    color: white;
    transform: scale(1.1);
}

.tab-btn.active {
    color: var(--sand); /* Gold accent per #359 AC */
}

/* Active tab indicator */
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--sand); /* Gold underline */
}

/* Tab SVG Icons (filled style like social icons) */
.tab-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ========================================
   Tab Content
   ======================================== */

.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Tab-specific backdrop colors (matching main site sections) */
.tab-panel {
    flex: 1;
    min-height: calc(100vh - 44px - 44px); /* Full height minus header and tabs */
    padding: var(--space-md);
    padding-bottom: calc(var(--space-xl) * 2); /* Room for status bar */
}

.tab-mail {
    background: var(--terracotta);
}

.tab-edit {
    background: var(--terracotta-dark);
}

.tab-search {
    background: var(--forest-600);
}

.tab-analytics {
    background: var(--forest-900);
}

.tab-panel {
    animation: fadeIn 0.2s ease;
}

.tab-panel h2 {
    font-size: var(--font-size-xl);
    font-weight: 400;
    margin: 0 0 var(--space-sm);
}

.tab-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg);
    line-height: 1.5;
}

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

/* ========================================
   Forms
   ======================================== */

.config-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    min-height: var(--touch-min);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base); /* 16px prevents iOS zoom */
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
}

/* Visibility Toggle */
.visibility-toggle {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.visibility-toggle .form-hint {
    display: block;
    margin-top: var(--space-xs);
    margin-left: 60px; /* Align with toggle text */
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    min-height: var(--touch-min);
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle-input:checked + .toggle-switch {
    background: var(--success);
}

.toggle-input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

.toggle-input:focus-visible + .toggle-switch {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.toggle-text {
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

/* Section hint (for Open Graph section) */
.section-hint {
    margin-top: calc(-1 * var(--space-sm));
    margin-bottom: var(--space-md);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-section-title {
    font-size: var(--font-size-base);
    font-weight: 500;
    margin: var(--space-lg) 0 var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

/* ========================================
   Collapsible Sections
   ======================================== */

.collapsible {
    margin-bottom: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.collapsible-header::-webkit-details-marker {
    display: none;
}

.collapsible-header::after {
    content: '+';
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.collapsible[open] .collapsible-header::after {
    content: '-';
}

.collapsible-content {
    padding: 0 var(--space-md) var(--space-md);
}

.item-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-left: var(--space-sm);
}

/* Nested collapsibles */
.collapsible.nested {
    background: rgba(0, 0, 0, 0.1);
    margin-top: var(--space-md);
}

.collapsible.nested .collapsible-header {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
}

/* ========================================
   Array Lists
   ======================================== */

.array-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.array-item {
    position: relative;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.array-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--touch-min);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.array-item-header:active {
    transform: scale(0.98);
}

.array-item.editing {
    border-color: var(--accent);
}

.array-item-title {
    font-weight: 500;
    flex: 1;
    padding-right: var(--space-sm);
}

.array-item-actions {
    display: flex;
    gap: var(--space-xs);
}

.array-item-btn {
    width: var(--touch-min);
    height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.array-item-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.array-item-btn.delete:hover {
    color: var(--error);
    border-color: var(--error);
}

.array-item-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.25s ease, padding-top 0.25s ease, opacity 0.2s ease;
}

.array-item-fields.hidden {
    max-height: 0;
    padding-top: 0;
    opacity: 0;
}

/* Simple list items (skills, languages) */
.simple-list .array-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
}

.simple-list .array-item-title {
    margin: 0;
}

.simple-list .array-item-actions {
    flex-shrink: 0;
}

/* Drag handle for reorderable items */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-min);
    height: var(--touch-min);
    margin-left: calc(-1 * var(--space-sm));
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    cursor: grab;
    transition: color var(--transition-fast);
    user-select: none;
    touch-action: none;
}

.drag-handle:hover {
    color: var(--text-primary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Draggable item states */
.array-item.draggable {
    cursor: default;
}

.array-item.dragging {
    opacity: 0.5;
    border-color: var(--accent);
}

.array-item.drop-above {
    border-top: 2px solid var(--accent);
}

.array-item.drop-below {
    border-bottom: 2px solid var(--accent);
}

/* Add button */
.add-btn {
    width: 100%;
    height: var(--touch-min);
    margin-top: var(--space-sm);
    font-size: var(--font-size-base);
    font-weight: 400;
    color: var(--accent);
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-btn:hover {
    border-color: var(--accent);
    background: rgba(213, 201, 148, 0.1);
}

/* ========================================
   Contact List
   ======================================== */

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.panel-header h2 {
    margin: 0;
}

.filter-select {
    height: var(--touch-min); /* 44px - Apple HIG minimum */
    padding: 0 var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.contact-item {
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.contact-item.unread {
    border-left: 3px solid var(--accent);
}

.contact-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.contact-name {
    font-weight: 500;
}

.contact-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.contact-email {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.contact-message {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    white-space: pre-wrap;
}

.contact-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.contact-action-btn {
    flex: 1;
    height: var(--touch-min);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.contact-action-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.loading-indicator {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-xl);
}

/* ========================================
   Status Bar
   ======================================== */

.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--touch-min);
    font-size: var(--font-size-sm);
    background: var(--forest-700);
    color: var(--text-primary);
    animation: slideUp 0.2s ease;
}

.status-bar.saving {
    background: var(--warning);
    color: var(--forest-900);
}

.status-bar.error {
    background: var(--error);
}

.status-bar.success {
    background: var(--success);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ========================================
   Mode Toggle Bar
   ======================================== */

.mode-toggle-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    height: 56px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.mode-toggle-btn {
    flex: 1;
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.mode-toggle-btn.active {
    color: var(--forest-900);
    background: var(--accent);
}

/* Preview mode - hide edit UI, show full preview */
body.preview-mode .tab-nav,
body.preview-mode .tab-content,
body.preview-mode .app-header {
    display: none;
}

body.preview-mode .device-preview-container {
    display: flex !important;
    position: fixed;
    top: 0;
    bottom: 56px;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-primary);
}

body.preview-mode .device-preview-header {
    display: none;
}

body.preview-mode .device-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

body.preview-mode .preview-iframe {
    width: 100%;
    height: 100%;
}

/* Status bar positioning (no mode toggle bar anymore) */
.status-bar {
    bottom: 0;
}

/* ========================================
   Tab Mini-Preview (section context)
   ======================================== */

.tab-preview {
    position: relative;
    width: 100%;
    height: 180px;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.tab-preview-iframe {
    width: 375px;
    height: 667px;
    border: none;
    transform: scale(0.48);
    transform-origin: top left;
    pointer-events: none;
}

.tab-preview-label {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-sm);
}

/* ========================================
   Device Preview (for testing)
   ======================================== */

.device-preview-container {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
}

.device-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 375px;
    padding: var(--space-sm) var(--space-md);
    background: #333;
    color: #fff;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.close-preview-btn {
    width: var(--touch-min);  /* 44px - Apple HIG minimum */
    height: var(--touch-min); /* 44px - Apple HIG minimum */
    font-size: var(--font-size-xl);
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
}

.device-preview-frame {
    width: 375px;
    height: 667px;
    background: var(--bg-primary);
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

/* ========================================
   Utility Classes
   ======================================== */

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mb-md {
    margin-bottom: var(--space-md);
}

/* ========================================
   Delete Confirmation Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.15s ease;
}

.modal-content {
    width: 100%;
    max-width: 320px;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 500;
    margin: 0 0 var(--space-sm);
}

.modal-message {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
}

.modal-btn {
    flex: 1;
    height: var(--touch-min); /* 44px - Apple HIG */
    font-size: var(--font-size-base);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-btn-cancel {
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-btn-delete {
    color: #fff;
    background: var(--error);
}

.modal-btn-delete:hover {
    background: #c0392b;
}

.modal-btn-primary {
    color: var(--forest-900);
    background: var(--accent);
}

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

.modal-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-btn-publish {
    color: white;
    background: var(--terracotta);
}

.modal-btn-publish:hover {
    background: var(--terracotta-dark);
}

/* Publish Modal */
.publish-modal-content {
    max-width: 360px;
    text-align: left;
}

.publish-changes-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.publish-change-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.publish-change-item::before {
    content: '•';
    color: var(--accent);
}

.publish-no-changes {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
}

/* Reply Modal Specific */
.reply-modal-content {
    max-width: 400px;
    width: 90%;
}

.reply-form {
    margin-bottom: var(--space-md);
}

.reply-form .form-group {
    margin-bottom: var(--space-md);
}

.reply-form .form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   Analytics Tab
   ======================================== */

.analytics-card {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.analytics-card h3 {
    font-size: var(--font-size-base);
    font-weight: 500;
    margin: 0 0 var(--space-md);
    color: var(--text-primary);
}

.chart-container {
    min-height: 150px;
    display: flex;
    align-items: flex-end;
    gap: var(--space-xs);
}

/* Simple bar chart bars */
.chart-bar {
    flex: 1;
    background: var(--accent);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height: 4px;
    position: relative;
}

.chart-bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.chart-bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-secondary);
}

.analytics-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.analytics-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.analytics-list-item:last-child {
    border-bottom: none;
}

.analytics-list-label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.analytics-list-value {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}
