/* ============================================================
   ContentForge - Main Stylesheet
   Dark Amber Editorial Theme
   ============================================================ */

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

:root {
    /* Core palette */
    --bg-primary: #0D0D14;
    --bg-secondary: #13131E;
    --bg-card: #181828;
    --bg-elevated: #1E1E32;
    --bg-input: #12121C;
    --bg-hover: #22223A;

    /* Brand colors */
    --gold: #D4A017;
    --gold-light: #E8C547;
    --gold-dim: #A07810;
    --gold-glow: rgba(212, 160, 23, 0.15);
    --accent: #E94560;
    --accent-dim: #C23350;
    --success: #2ECC71;
    --warning: #F39C12;
    --error: #E74C3C;
    --info: #3498DB;

    /* Text */
    --text-primary: #E8E4DD;
    --text-secondary: #9A9590;
    --text-muted: #5C5856;
    --text-accent: var(--gold);

    /* Borders */
    --border: rgba(212, 160, 23, 0.12);
    --border-hover: rgba(212, 160, 23, 0.25);
    --border-active: rgba(212, 160, 23, 0.5);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-gold: 0 0 20px rgba(212, 160, 23, 0.1);

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Platform colors */
    --color-tiktok: #000000;
    --color-instagram: #E4405F;
    --color-facebook: #1877F2;
    --color-pinterest: #E60023;
    --color-twitter: #000000;
    --color-reddit: #FF4500;
    --color-tumblr: #36465D;
    --color-youtube: #FF0000;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

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

::selection { background: var(--gold); color: var(--bg-primary); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ============================================================
   LAYOUT
   ============================================================ */

.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bg-primary);
}

.sidebar-brand h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav-section {
    padding: 0.5rem 1.5rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-nav a, .sidebar-nav button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.sidebar-nav a:hover, .sidebar-nav button:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-nav a.active { color: var(--gold); background: var(--gold-glow); border-right: 2px solid var(--gold); }
.sidebar-nav a .nav-icon, .sidebar-nav button .nav-icon { width: 18px; height: 18px; opacity: 0.7; }
.sidebar-nav a.active .nav-icon { opacity: 1; }

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(13, 13, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar .page-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-area {
    padding: 2rem;
    max-width: 1400px;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: var(--bg-primary);
    border-color: var(--gold);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 0.75rem;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-danger { background: var(--error); color: white; border-color: var(--error); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

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

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border-hover); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; }

/* Form Elements */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* Toggle */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--gold); border-color: var(--gold); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--bg-primary); }

/* Tags / Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.badge-gold { background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(212,160,23,0.2); }
.badge-success { background: rgba(46,204,113,0.12); color: var(--success); }
.badge-error { background: rgba(231,76,60,0.12); color: var(--error); }

/* Platform Chips */
.platform-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}
.platform-chip:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.platform-chip.selected { border-color: var(--gold); background: var(--gold-glow); color: var(--gold); }
.platform-chip .dot { width: 8px; height: 8px; border-radius: 50%; }

/* Content Cards Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}
.content-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.content-card .cc-media { height: 180px; background: var(--bg-elevated); position: relative; overflow: hidden; }
.content-card .cc-media img { width: 100%; height: 100%; object-fit: cover; }
.content-card .cc-body { padding: 1rem; }
.content-card .cc-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-weight: 600; margin-bottom: 0.4rem; }
.content-card .cc-text { font-size: 0.9rem; color: var(--text-primary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.content-card .cc-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.content-card .cc-date { font-size: 0.75rem; color: var(--text-muted); }

/* Language Selector */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 0.15rem;
}
.lang-selector button {
    padding: 0.3rem 0.65rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.2s;
}
.lang-selector button.active { background: var(--gold); color: var(--bg-primary); font-weight: 600; }

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* Toast Notifications */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading Spinner */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(4px);
}
.loading-overlay .spinner { width: 40px; height: 40px; border-width: 3px; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.stat-card .stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .stat-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; color: var(--gold); margin: 0.25rem 0; }
.stat-card .stat-sub { font-size: 0.8rem; color: var(--text-secondary); }

/* ============================================================
   PAGES - AUTH
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(212,160,23,0.04) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 20%, rgba(233,69,96,0.03) 0%, transparent 50%);
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.auth-box .auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-box .auth-logo .logo-mark {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bg-primary);
    margin-bottom: 0.75rem;
}

.auth-box h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

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

.auth-box .form-input {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    background: var(--bg-secondary);
}

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

/* ============================================================
   PAGES - CREATE CONTENT
   ============================================================ */

.create-wizard { max-width: 900px; }

.create-wizard .step-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.create-wizard .step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 2px solid var(--border);
    transition: all 0.3s;
}
.create-wizard .step-dot.active { background: var(--gold); color: var(--bg-primary); border-color: var(--gold); }
.create-wizard .step-dot.done { background: var(--success); color: white; border-color: var(--success); }
.create-wizard .step-line { flex: 1; height: 1px; background: var(--border); }

.type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.type-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.type-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.type-card.selected { border-color: var(--gold); background: var(--gold-glow); }
.type-card .type-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.type-card .type-name { font-size: 0.85rem; font-weight: 500; }

/* Result Preview */
.result-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 1.5rem;
}

.result-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ============================================================
   MOBILE HAMBURGER
   ============================================================ */

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .hamburger { display: block; }

    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }

    .main-content { margin-left: 0; }
    .content-area { padding: 1rem; }
    .top-bar { padding: 0.75rem 1rem; }

    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .type-selector { grid-template-columns: repeat(2, 1fr); }
    .create-wizard .step-indicator { display: none; }

    .auth-box { padding: 1.5rem; }
}

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

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-in { animation: slideUp 0.4s ease both; }
.animate-fade { animation: fadeIn 0.3s ease; }
.animate-pulse { animation: pulse 1.5s infinite; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
