/* ============================================================
   ContentForge - Premium Dark Theme Stylesheet
   A modern, glassmorphism-inspired dark UI
   ============================================================ */

/* ----------------------------------------------------------
   1. Design System - CSS Custom Properties
   ---------------------------------------------------------- */
:root {
    --bg-primary: #0f1012;
    --bg-secondary: #16171a;
    --bg-tertiary: #1c1d22;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --border-color-focus: rgba(211, 86, 62, 0.5);
    --text-primary: #e8e8ed;
    --text-secondary: #8b8b9e;
    --text-muted: #55556a;
    --accent-primary: #d3563e;
    --accent-secondary: #b8452f;
    --accent-gradient: linear-gradient(135deg, #d3563e, #b8452f);
    --accent-glow: 0 0 20px rgba(211, 86, 62, 0.3);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(211, 86, 62, 0.15);
    --transition: all 0.1s ease;
    --sidebar-width: 260px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ----------------------------------------------------------
   3. Typography
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
}

/* ----------------------------------------------------------
   4. Custom Scrollbar
   ---------------------------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-corner {
    background: var(--bg-primary);
}

/* ----------------------------------------------------------
   5. Selection
   ---------------------------------------------------------- */
::selection {
    background: var(--accent-primary);
    color: #fff;
}

::-moz-selection {
    background: var(--accent-primary);
    color: #fff;
}

/* ----------------------------------------------------------
   6. Sidebar
   ---------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 500;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem 0.75rem;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: var(--radius-md);
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 99, 255, 0.12);
    color: var(--accent-primary);
    font-weight: 500;
}

.nav-item.active::before {
    opacity: 0.08;
}

.nav-item svg,
.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg,
.nav-item.active i {
    opacity: 1;
}

.sidebar-user {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.logout-btn {
    margin-left: auto;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* ----------------------------------------------------------
   7. Main Content
   ---------------------------------------------------------- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* ----------------------------------------------------------
   8. Auth Pages
   ---------------------------------------------------------- */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        var(--bg-primary);
    padding: 2rem;
}

.auth-card {
    max-width: 440px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108, 99, 255, 0.4), transparent);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.auth-logo .logo-icon {
    width: 48px;
    height: 48px;
}

.auth-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--accent-primary);
    font-weight: 500;
    transition: var(--transition);
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--accent-secondary);
}

/* ----------------------------------------------------------
   9. Buttons
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 12px rgba(108, 99, 255, 0.25);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

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

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

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

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

.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ----------------------------------------------------------
   10. Forms
   ---------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input,
textarea.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}

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

.form-input:focus {
    border-color: var(--border-color-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8b9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.form-select:focus {
    border-color: var(--border-color-focus);
    background-color: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .form-input {
    padding-left: 44px;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent-primary);
    border-color: rgba(108, 99, 255, 0.2);
}

/* ----------------------------------------------------------
   11. Cards
   ---------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.card:hover {
    border-color: var(--border-color-hover);
}

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

.card-header h3 {
    font-weight: 600;
    font-size: 1rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ----------------------------------------------------------
   12. Stats Grid
   ---------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.accent {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent-primary);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-secondary);
}

.stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-value {
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ----------------------------------------------------------
   13. Badges
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1.4;
    gap: 4px;
}

.badge-post {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-secondary);
}

.badge-story {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent-primary);
}

.badge-default,
.default-badge {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ----------------------------------------------------------
   14. Upload Zone
   ---------------------------------------------------------- */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    transform: scale(1.01);
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 0.03;
}

.upload-zone.dragover {
    border-color: var(--accent-secondary);
    box-shadow: var(--accent-glow);
}

.upload-zone > * {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ----------------------------------------------------------
   15. Editor Layout
   ---------------------------------------------------------- */
.editor-layout {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 1.5rem;
    min-height: 70vh;
}

/* Image List Panel */
.image-list-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-weight: 600;
    font-size: 0.9rem;
}

.panel-header .count {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.image-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
    gap: 2px;
}

.image-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    user-select: none;
}

.image-item:hover {
    background: var(--bg-card-hover);
}

.image-item.selected {
    border-color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.08);
}

.image-item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.image-item-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.image-item.selected .image-item-name {
    color: var(--text-primary);
}

.image-item-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.image-item.selected .image-item-check {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.image-item.selected .image-item-check::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Preview Panel */
.preview-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.preview-header {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin-bottom: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    width: 100%;
}

.format-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.format-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.format-tab.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.preview-canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0.5rem;
    min-height: 0;
    position: relative;
}

#previewCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 1rem);
    max-height: calc(100% - 1rem);
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
    padding: 3rem;
    text-align: center;
}

.preview-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.preview-placeholder p {
    font-size: 0.9rem;
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}

.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* ----------------------------------------------------------
   16. Format Checkboxes
   ---------------------------------------------------------- */
.format-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    user-select: none;
}

.checkbox-wrap:hover {
    background: var(--bg-card-hover);
}

.checkbox-wrap input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-wrap input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.checkbox-wrap:hover .checkbox-label {
    color: var(--text-primary);
}

.checkbox-wrap input[type="checkbox"]:checked ~ .checkbox-label {
    color: var(--text-primary);
}

/* ----------------------------------------------------------
   17. Mode Selector
   ---------------------------------------------------------- */
.mode-selector {
    display: flex;
    flex-direction: row;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.mode-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.mode-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.mode-btn svg {
    width: 16px;
    height: 16px;
}

/* ----------------------------------------------------------
   18. Color Picker
   ---------------------------------------------------------- */
.color-picker-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-section {
    transition: all 0.3s ease;
}

.color-section.hidden {
    display: none;
}

.color-input {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.color-input::-moz-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.color-presets {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    outline: none;
}

.color-preset:hover {
    transform: scale(1.15);
    border-color: var(--border-color-hover);
}

.color-preset.active,
.color-preset.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
    transform: scale(1.1);
}

/* ----------------------------------------------------------
   19. Footer Selector
   ---------------------------------------------------------- */
.footer-select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-preview-small {
    max-height: 60px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-top: 4px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.footer-preview-small img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    display: block;
}

/* ----------------------------------------------------------
   20. Range Input
   ---------------------------------------------------------- */
.range-input {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    margin: 8px 0;
    cursor: pointer;
}

.range-input::-webkit-slider-track {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(108, 99, 255, 0.4);
    margin-top: -7px;
    transition: transform 0.15s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-input::-moz-range-track {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    border: none;
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(108, 99, 255, 0.4);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ----------------------------------------------------------
   21. Action Bar
   ---------------------------------------------------------- */
.action-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.action-bar-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-bar-info strong {
    color: var(--text-primary);
}

.action-bar-buttons {
    display: flex;
    gap: 0.75rem;
}

/* ----------------------------------------------------------
   22. Footer Management
   ---------------------------------------------------------- */
.footer-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.footer-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.footer-section-header h3 {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.footer-section-header h3 svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.footer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

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

.footer-card-preview {
    aspect-ratio: auto;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.5rem;
}

.footer-card-preview img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.footer-card-info {
    padding: 0.75rem;
}

.footer-card-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.footer-card-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

/* ----------------------------------------------------------
   23. History Page
   ---------------------------------------------------------- */
.history-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-card);
}

.history-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

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

.history-card-img {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.history-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.history-card:hover .history-card-img img {
    transform: scale(1.05);
}

.history-card-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-card-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.history-card-check input[type="checkbox"] {
    display: none;
}

.history-card-check .checkbox-custom {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.time-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-badge svg {
    width: 12px;
    height: 12px;
}

/* ----------------------------------------------------------
   24. Modals
   ---------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 2rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-card), 0 0 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h3 {
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   25. Toast Notifications
   ---------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    min-width: 300px;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.toast-success::before {
    background: var(--success);
}

.toast-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.toast-error::before {
    background: var(--danger);
}

.toast-info {
    background: rgba(108, 99, 255, 0.12);
    border: 1px solid rgba(108, 99, 255, 0.2);
    color: var(--accent-primary);
}

.toast-info::before {
    background: var(--accent-primary);
}

.toast-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.toast-warning::before {
    background: var(--warning);
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 2px;
    display: flex;
    transition: opacity 0.2s ease;
}

.toast-close:hover {
    opacity: 1;
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(100%);
}

/* ----------------------------------------------------------
   26. Loading Overlay
   ---------------------------------------------------------- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

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

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------
   27. Empty State
   ---------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 360px;
}

.empty-state .btn {
    margin-top: 1.5rem;
}

/* ----------------------------------------------------------
   28. Animations
   ---------------------------------------------------------- */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

.slide-down {
    animation: slideDown 0.3s ease forwards;
}

/* ----------------------------------------------------------
   29. Image Grid (Dashboard)
   ---------------------------------------------------------- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.image-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

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

.image-card-preview {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.image-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover .image-card-preview img {
    transform: scale(1.05);
}

.image-card-info {
    padding: 0.75rem;
}

.image-card-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ----------------------------------------------------------
   30. Responsive
   ---------------------------------------------------------- */

/* Mobile header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 400;
}

.mobile-menu-toggle {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle svg {
    width: 22px;
    height: 22px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 499;
}

@media (max-width: 1200px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 4rem;
    }

    .editor-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .image-list-panel {
        max-height: 300px;
    }

    .action-bar {
        left: 0;
        padding: 0.75rem 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .history-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .footer-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .preview-header {
        flex-wrap: wrap;
    }

    .format-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .modal {
        width: 95%;
        margin: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .toast {
        min-width: 260px;
        max-width: calc(100vw - 3rem);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
        padding-top: 4rem;
    }

    .page-title {
        font-size: 1.35rem;
    }
}

/* ----------------------------------------------------------
   31. Utilities & Misc
   ---------------------------------------------------------- */

/* Focus-visible for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

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

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

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

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

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

.text-accent {
    color: var(--accent-primary);
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

/* Margins */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.ml-1 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.5rem; }

/* Gaps */
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Width */
.w-full { width: 100%; }

/* Truncate */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

/* Clickable overlay for cards */
.card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Select all bar in editor */
.select-all-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.select-all-bar label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    z-index: 10;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Table styles for potential admin pages */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    font-size: 0.9rem;
}

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

tr:hover td {
    background: var(--bg-card-hover);
}

/* Footer file input preview in upload modal */
.file-preview {
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    padding: 0.5rem;
    display: none;
}

.file-preview.active {
    display: block;
}

.file-preview img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    padding: 4px;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-bg);
}

/* Notification dot */
.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
    animation: pulse 2s infinite;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Print styles - hide non-essential elements */
@media print {
    .sidebar,
    .action-bar,
    .toast-container,
    .loading-overlay,
    .modal-overlay,
    .mobile-menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}
