/* ==========================================================
   SOCIAL MEDIA MANAGER - DESIGN SYSTEM & STYLES
   Premium SaaS-style CSS with glassmorphism,
   smooth transitions, and responsive design.
   ========================================================== */

/* ──────────────────────────────────────────────
   CSS CUSTOM PROPERTIES (Design Tokens)
   ────────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --primary-hue: 250;
    --primary: hsl(var(--primary-hue), 90%, 60%);
    --primary-light: hsl(var(--primary-hue), 90%, 70%);
    --primary-dark: hsl(var(--primary-hue), 90%, 50%);
    --primary-glow: hsla(var(--primary-hue), 90%, 60%, 0.25);

    /* Accent Colors */
    --accent-blue: hsl(210, 90%, 58%);
    --accent-green: hsl(155, 75%, 50%);
    --accent-orange: hsl(28, 95%, 58%);
    --accent-red: hsl(0, 80%, 60%);
    --accent-pink: hsl(330, 85%, 60%);

    /* Instagram Gradient */
    --instagram-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --facebook-color: #1877F2;

    /* Surface Colors (Dark Theme) */
    --bg-base: hsl(228, 25%, 8%);
    --bg-surface: hsl(228, 22%, 11%);
    --bg-card: hsl(228, 20%, 14%);
    --bg-elevated: hsl(228, 18%, 18%);
    --bg-hover: hsl(228, 18%, 20%);
    --bg-input: hsl(228, 22%, 12%);

    /* Border Colors */
    --border-subtle: hsla(228, 15%, 40%, 0.15);
    --border-default: hsla(228, 15%, 40%, 0.25);
    --border-focus: var(--primary);

    /* Text Colors */
    --text-primary: hsl(228, 15%, 92%);
    --text-secondary: hsl(228, 10%, 62%);
    --text-muted: hsl(228, 10%, 42%);
    --text-inverse: hsl(228, 25%, 8%);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 0.6875rem;
    /* 11px */
    --font-sm: 0.8125rem;
    /* 13px */
    --font-base: 0.9375rem;
    /* 15px */
    --font-md: 1.0625rem;
    /* 17px */
    --font-lg: 1.25rem;
    /* 20px */
    --font-xl: 1.5rem;
    /* 24px */
    --font-2xl: 2rem;
    /* 32px */

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.25);
    --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.3);
    --shadow-lg: 0 8px 30px hsla(0, 0%, 0%, 0.35);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}


/* ──────────────────────────────────────────────
   RESET & BASE
   ────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

input,
textarea,
select {
    font-family: inherit;
}


/* ──────────────────────────────────────────────
   SIDEBAR
   ────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-slow), transform var(--transition-slow);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-header {
    padding: var(--space-4) var(--space-3);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    min-height: 65px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-md);
    flex-shrink: 0;
}

.logo-text {
    font-size: var(--font-lg);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xs);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

.sidebar-toggle i {
    transition: transform var(--transition-base);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

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

.nav-link.active {
    color: var(--primary-light);
    background: hsla(var(--primary-hue), 90%, 60%, 0.1);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: var(--font-base);
    flex-shrink: 0;
}

.nav-link span {
    transition: opacity var(--transition-base), width var(--transition-base);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4) var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-sm);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    transition: opacity var(--transition-base), width var(--transition-base);
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: var(--font-sm);
    color: var(--text-primary);
}

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


/* ──────────────────────────────────────────────
   MAIN WRAPPER & TOPBAR
   ────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

.sidebar.collapsed~.main-wrapper {
    margin-left: var(--sidebar-collapsed);
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: hsla(228, 25%, 8%, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    z-index: 50;
}

.mobile-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    font-size: var(--font-md);
}

.page-title {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-fast);
}

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

.topbar-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--accent-red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ──────────────────────────────────────────────
   CONTENT AREA
   ────────────────────────────────────────────── */
.content {
    padding: var(--space-8);
    max-width: 1400px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ──────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 0.08;
}

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

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

.btn:disabled::after {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px var(--primary-glow);
}

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

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

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

.btn-ai {
    background: linear-gradient(135deg, hsl(280, 85%, 55%), hsl(330, 85%, 55%));
    color: white;
    font-size: var(--font-xs);
    padding: var(--space-2) var(--space-3);
    box-shadow: 0 2px 10px hsla(280, 85%, 55%, 0.3);
}

.btn-ai:hover {
    box-shadow: 0 4px 20px hsla(280, 85%, 55%, 0.4);
}

.btn-glass {
    background: hsla(0, 0%, 100%, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid hsla(0, 0%, 100%, 0.2);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-xs);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-base);
}

.btn-full {
    width: 100%;
}

/* Button loading state */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    color: white;
}

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


/* ──────────────────────────────────────────────
   CARDS
   ────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

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

.card-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-title i {
    font-size: var(--font-sm);
    color: var(--primary-light);
}

.card-body {
    padding: var(--space-5);
}


/* ──────────────────────────────────────────────
   DASHBOARD - STATS GRID
   ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-base);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
    flex-shrink: 0;
}

.stat-icon-purple {
    background: hsla(var(--primary-hue), 90%, 60%, 0.15);
    color: var(--primary-light);
}

.stat-icon-blue {
    background: hsla(210, 90%, 58%, 0.15);
    color: var(--accent-blue);
}

.stat-icon-green {
    background: hsla(155, 75%, 50%, 0.15);
    color: var(--accent-green);
}

.stat-icon-orange {
    background: hsla(28, 95%, 58%, 0.15);
    color: var(--accent-orange);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: var(--font-2xl);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.stat-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 500;
    margin-top: var(--space-1);
}


/* ──────────────────────────────────────────────
   DASHBOARD - GRID LAYOUT
   ────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}


/* ──────────────────────────────────────────────
   QUICK ACTIONS
   ────────────────────────────────────────────── */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
    text-align: center;
}

.quick-action-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-default);
    transform: translateY(-2px);
}

.quick-action-item span {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-md);
}

.qa-purple {
    background: hsla(var(--primary-hue), 90%, 60%, 0.15);
    color: var(--primary-light);
}

.qa-blue {
    background: hsla(210, 90%, 58%, 0.15);
    color: var(--accent-blue);
}

.qa-green {
    background: hsla(155, 75%, 50%, 0.15);
    color: var(--accent-green);
}

.qa-orange {
    background: hsla(28, 95%, 58%, 0.15);
    color: var(--accent-orange);
}


/* ──────────────────────────────────────────────
   ACTIVITY LIST
   ────────────────────────────────────────────── */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: var(--bg-surface);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.dot-green {
    background: var(--accent-green);
}

.dot-red {
    background: var(--accent-red);
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.activity-text {
    font-size: var(--font-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: var(--font-xl);
    color: var(--text-muted);
}

.empty-state p {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.empty-state span {
    font-size: var(--font-sm);
    color: var(--text-muted);
}


/* ──────────────────────────────────────────────
   PLATFORM CARDS (Dashboard)
   ────────────────────────────────────────────── */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.platform-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.platform-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-md);
    color: white;
}

.platform-icon.instagram {
    background: var(--instagram-gradient);
}

.platform-icon.facebook {
    background: var(--facebook-color);
}

.platform-icon.x-twitter {
    background: #000000;
}

.platform-icon.linkedin {
    background: #0077b5;
}

.platform-info {
    display: flex;
    flex-direction: column;
}

.platform-name {
    font-weight: 600;
    font-size: var(--font-sm);
}

.platform-status {
    font-size: var(--font-xs);
}

.status-ready {
    color: var(--accent-green);
}

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


/* ──────────────────────────────────────────────
   CREATE POST LAYOUT
   ────────────────────────────────────────────── */
.create-post-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-6);
    align-items: start;
}

.create-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.create-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-8));
}


/* ──────────────────────────────────────────────
   AI PROMPT SECTION
   ────────────────────────────────────────────── */
.ai-prompt-section {
    margin-bottom: var(--space-4);
    animation: slideDown 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    display: flex;
    gap: var(--space-2);
}

.input-group .form-input {
    flex: 1;
}

.input-group .btn {
    padding: var(--space-2) var(--space-4);
    flex-shrink: 0;
}


/* ──────────────────────────────────────────────
   DROP ZONE (Image Upload)
   ────────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: hsla(var(--primary-hue), 90%, 60%, 0.05);
}

.drop-zone.drag-over {
    border-style: solid;
    box-shadow: inset 0 0 30px var(--primary-glow);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.drop-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-xl);
    background: hsla(var(--primary-hue), 90%, 60%, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    color: var(--primary-light);
    margin-bottom: var(--space-2);
}

.drop-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-md);
}

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

.drop-formats {
    color: var(--text-muted);
    font-size: var(--font-xs);
    margin-top: var(--space-2);
}


/* ──────────────────────────────────────────────
   IMAGE PREVIEW
   ────────────────────────────────────────────── */
.image-preview-wrapper {
    position: relative;
    width: 100%;
}

.image-preview-wrapper img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.image-actions {
    position: absolute;
    bottom: var(--space-3);
    right: var(--space-3);
    display: flex;
    gap: var(--space-2);
}


/* ──────────────────────────────────────────────
   SKELETON LOADERS
   ────────────────────────────────────────────── */
.skeleton-loader {
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
}

.skeleton-shimmer {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg,
            var(--bg-elevated) 25%,
            var(--bg-hover) 50%,
            var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    font-size: var(--font-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.skeleton-text-loader {
    min-height: 100px;
}

.skeleton-line {
    height: 14px;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg,
            var(--bg-elevated) 25%,
            var(--bg-hover) 50%,
            var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    width: 100%;
}

.skeleton-line-md {
    width: 75%;
}

.skeleton-line-sm {
    width: 50%;
}


/* ──────────────────────────────────────────────
   FORM ELEMENTS
   ────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

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

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.datetime-input {
    color-scheme: dark;
}

/* Textarea */
.textarea-wrapper {
    position: relative;
}

.form-textarea {
    width: 100%;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--font-base);
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: all var(--transition-fast);
    min-height: 160px;
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    padding: var(--space-2) 0;
}

.char-counter {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.char-counter.warning {
    color: var(--accent-orange);
}

.char-counter.danger {
    color: var(--accent-red);
}


/* ──────────────────────────────────────────────
   PLATFORM CHECKBOXES (Create Post)
   ────────────────────────────────────────────── */
.platform-checks {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.platform-check {
    cursor: pointer;
}

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

.check-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    transition: all var(--transition-fast);
}

.platform-check input:checked+.check-card {
    border-color: var(--primary);
    background: hsla(var(--primary-hue), 90%, 60%, 0.08);
}

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

.check-card i {
    font-size: var(--font-lg);
}

.check-card .fa-instagram {
    background: var(--instagram-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.check-card .fa-facebook-f {
    color: var(--facebook-color);
}

.check-card .fa-x-twitter {
    color: #000000;
}

.check-card span {
    font-weight: 500;
    font-size: var(--font-sm);
}

.platform-hint {
    font-size: var(--font-xs);
    color: var(--accent-red);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.schedule-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}


/* ──────────────────────────────────────────────
   ACTION BUTTONS (Create Post Sidebar)
   ────────────────────────────────────────────── */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}


/* ──────────────────────────────────────────────
   LIVE PREVIEW (Phone Mock)
   ────────────────────────────────────────────── */
.preview-phone {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.preview-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
}

.preview-username {
    font-size: var(--font-sm);
    font-weight: 600;
}

.preview-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    color: var(--text-muted);
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-caption {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-sm);
    line-height: 1.5;
}

.preview-username-bold {
    font-weight: 700;
    margin-right: var(--space-2);
}

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


/* ──────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

.toast-icon {
    font-size: var(--font-md);
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--accent-green);
}

.toast-error .toast-icon {
    color: var(--accent-red);
}

.toast-info .toast-icon {
    color: var(--accent-blue);
}

.toast-message {
    flex: 1;
    font-size: var(--font-sm);
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xs);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}


/* ──────────────────────────────────────────────
   SCHEDULED POSTS PAGE
   ────────────────────────────────────────────── */
.scheduled-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.scheduled-stats {
    display: flex;
    gap: var(--space-3);
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.stat-pill i {
    color: var(--primary-light);
}

.stat-pill strong {
    color: var(--text-primary);
    font-weight: 700;
}

.scheduled-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-5);
}

.scheduled-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    animation: fadeInUp 0.4s ease;
}

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

.scheduled-card.removing {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: all 0.35s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scheduled-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.scheduled-time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.scheduled-time i {
    color: var(--primary-light);
}

.status-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-scheduled {
    background: hsla(210, 90%, 58%, 0.15);
    color: var(--accent-blue);
}

.status-cancelled {
    background: hsla(0, 85%, 58%, 0.15);
    color: var(--accent-red);
}

.status-published {
    background: hsla(155, 75%, 50%, 0.15);
    color: var(--accent-green);
}

.scheduled-card-body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.scheduled-platforms {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.platform-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 500;
}

.platform-tag-instagram {
    background: hsla(330, 80%, 55%, 0.12);
    color: hsl(330, 80%, 60%);
}

.platform-tag-facebook {
    background: hsla(220, 80%, 55%, 0.12);
    color: var(--facebook-color);
}

.platform-tag-x {
    background: hsla(0, 0%, 50%, 0.12);
    color: var(--text-primary);
}

.scheduled-caption p {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
}

.scheduled-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 180px;
}

.scheduled-image img {
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.scheduled-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.scheduled-card-footer .btn {
    font-size: var(--font-xs);
}

.scheduled-card-footer .btn:hover {
    color: var(--accent-red);
}


/* ──────────────────────────────────────────────
   RESPONSIVE DESIGN
   ────────────────────────────────────────────── */

/* Tablets & small desktops */
@media (max-width: 1200px) {
    .create-post-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .create-post-layout {
        grid-template-columns: 1fr;
    }

    .create-sidebar {
        position: static;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        z-index: 200;
    }

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

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar.collapsed~.main-wrapper {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .topbar {
        padding: 0 var(--space-4);
    }

    .content {
        padding: var(--space-4);
    }

    .page-title {
        font-size: var(--font-lg);
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

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

    .drop-zone {
        padding: var(--space-6);
        min-height: 200px;
    }

    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

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

    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-actions .btn span {
        display: none;
    }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    animation: fadeIn 0.3s ease;
}

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