/* ============================================================
   SocialAI Pro - Custom Styles
   Built on Tailwind CSS via CDN
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --surface: #0f172a;
    --surface-2: #1e293b;
    --surface-3: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --glow: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] {
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --glow: rgba(99, 102, 241, 0.08);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--surface);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Glass morphism cards */
.glass {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
}
[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #0ea5e9, #6366f1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
    to { background-position: 200% center; }
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1a1e3a 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right-color: #e2e8f0;
}

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

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 12px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.sidebar .nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
}
.sidebar .nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(14, 165, 233, 0.1));
    color: #818cf8;
    box-shadow: inset 3px 0 0 #6366f1;
}
[data-theme="light"] .sidebar .nav-item { color: #64748b; }
[data-theme="light"] .sidebar .nav-item:hover { color: #4f46e5; background: rgba(99, 102, 241, 0.06); }
[data-theme="light"] .sidebar .nav-item.active { color: #4f46e5; }

.sidebar .nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar .nav-section { padding: 20px 16px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #475569; font-weight: 700; }

/* Main content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* Top bar */
.topbar {
    height: 64px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}
[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: #e2e8f0;
}

/* Stat cards */
.stat-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(30, 41, 59, 0.4));
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 16px;
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.3); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30%, -30%);
}
.stat-card.purple::before { background: #6366f1; }
.stat-card.blue::before { background: #0ea5e9; }
.stat-card.green::before { background: #10b981; }
.stat-card.amber::before { background: #f59e0b; }

[data-theme="light"] .stat-card {
    background: white;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4); }
.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 12px; }

/* Form inputs */
.form-input {
    width: 100%;
    padding: 10px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--glow); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input { cursor: pointer; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.data-table tr:hover td { background: rgba(99, 102, 241, 0.03); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-info { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.badge-primary { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-neutral { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.toast-success { background: #065f46; color: #d1fae5; border: 1px solid #10b981; }
.toast-error { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Platform icons */
.platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.platform-facebook { background: rgba(24, 119, 242, 0.15); color: #1877F2; }
.platform-instagram { background: rgba(228, 64, 95, 0.15); color: #E4405F; }
.platform-whatsapp { background: rgba(37, 211, 102, 0.15); color: #25D366; }
.platform-linkedin { background: rgba(10, 102, 194, 0.15); color: #0A66C2; }

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

/* Pricing card */
.pricing-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(30, 41, 59, 0.4));
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 20px;
    padding: 32px;
    position: relative;
    transition: all 0.3s;
}
.pricing-card.featured {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
}
.pricing-card:hover { transform: translateY(-4px); }
[data-theme="light"] .pricing-card {
    background: white;
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}
[data-theme="light"] .pricing-card.featured { border-color: #6366f1; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: all 0.3s;
}
.modal-overlay.active .modal-content { transform: scale(1); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 16px; opacity: 0.3; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* Animated gradient bg for auth pages */
.auth-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1a1035 25%, #0f172a 50%, #0a1628 75%, #0f172a 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(14, 165, 233, 0.06) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-0.5deg); }
}

/* Pulse animation for live indicators */
.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
