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

:root {
    --bg: #f8f9fa;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #718096;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.nav-link { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; }
.nav-link:hover { color: var(--text); }
.nav-user { font-size: 0.85rem; color: var(--text-muted); }

/* Container */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Login */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.login-card h1 { font-size: 1.8rem; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--card);
}
.form-group textarea { resize: vertical; }
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.char-count { font-size: 0.8rem; color: var(--text-muted); text-align: right; margin-top: 0.25rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--card); color: var(--text); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Dashboard */
.dashboard .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 700; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-success .stat-number { color: var(--success); }
.stat-danger .stat-number { color: var(--danger); }

/* Section */
.section { margin-bottom: 2rem; }
.section h2 { margin-bottom: 1rem; font-size: 1.15rem; }

/* Accounts */
.accounts-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.account-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
}
.account-actions { display: flex; gap: 0.5rem; }

/* Posts List (card style with video preview) */
.posts-list { display: flex; flex-direction: column; gap: 1rem; }
.post-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.post-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.post-card-body { display: flex; gap: 1rem; padding: 1rem; }
.post-media { flex-shrink: 0; width: 140px; }
.post-video, .post-media img {
    width: 140px;
    height: 248px;
    object-fit: cover;
    border-radius: 6px;
    background: #0f172a;
}
.post-info { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.post-text {
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}
.post-platforms { font-weight: 500; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.post-error { font-size: 0.8rem; color: var(--danger); background: #fef2f2; padding: 0.4rem 0.6rem; border-radius: 4px; }

/* Media Upload */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.upload-area:hover { border-color: var(--primary); }
.upload-icon { font-size: 2rem; }
.upload-text { font-weight: 500; }
.upload-hint { font-size: 0.8rem; color: var(--text-muted); }
.media-preview { position: relative; }
.media-preview video, .media-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius);
    background: #000;
}
.media-preview .btn { position: absolute; top: 0.5rem; right: 0.5rem; }

/* Checkbox */
.platform-select { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.platform-tag { font-size: 0.9rem; }

/* Alerts */
.alert { padding: 0.75rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* Status badges */
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.rounded { border-radius: 9999px; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.bg-gray-200 { background: #e2e8f0; } .text-gray-700 { color: #4a5568; }
.bg-blue-100 { background: #dbeafe; } .text-blue-700 { color: #1d4ed8; }
.bg-yellow-100 { background: #fef3c7; } .text-yellow-700 { color: #a16207; }
.bg-green-100 { background: #d1fae5; } .text-green-700 { color: #047857; }
.bg-red-100 { background: #fee2e2; } .text-red-700 { color: #b91c1c; }

/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox-overlay.active { display: flex; }
.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}
.lightbox-content img, .lightbox-content video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
    padding: 8px 16px;
    opacity: 0.6;
    transition: opacity 0.15s;
    user-select: none;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    opacity: 0.7;
    z-index: 1001;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .container { padding: 1rem; }
    .dashboard .header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
    .post-card-body { flex-direction: column; }
    .post-media { width: 100%; }
    .post-video, .post-media img { width: 100%; height: 300px; }
}
