/* ==========================================================================
   Sosmed Dashboard — Premium Modern Dark Design System
   ========================================================================== */

:root {
    --bg-dark: #0F1117;
    --card-bg: #1A1D29;
    --card-hover: #212536;
    --border-color: #2D3248;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* Social Platform Colors */
    --color-ig: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --color-fb: #1877F2;
    --color-tiktok-cyan: #25F4EE;
    --color-tiktok-pink: #FE2C55;
    --color-x: #E7E9EA;
    --color-threads: #FFFFFF;

    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.shadow-glass {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #141722;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 8px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.brand-text h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.version-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
    border-left: 3px solid var(--primary);
}

.nav-item i {
    font-size: 16px;
    width: 20px;
}

.nav-item .badge {
    margin-left: auto;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

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

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}

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

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    max-width: 1600px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Badges */
.badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #3B82F6; border: 1px solid rgba(59, 130, 246, 0.3); }

/* Live Status Dot with Pulse */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-dot.connected {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-dot.connected::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--success);
    animation: pulse 2s infinite;
    top: 0; left: 0;
}

.status-dot.warning { background-color: var(--warning); }
.status-dot.disconnected { background-color: var(--danger); }

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Views & Tabs */
.tab-view {
    display: none;
}

.tab-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.icon-purple { background: rgba(99, 102, 241, 0.15); color: #818CF8; }
.icon-pink { background: rgba(236, 72, 153, 0.15); color: #F472B6; }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: #22D3EE; }
.icon-gold { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }

.stat-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.stat-growth {
    font-size: 12px;
    font-weight: 500;
}

.stat-growth.positive { color: var(--success); }

/* Platform Pills Row */
.platform-pills-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    margin-bottom: 24px;
    padding-bottom: 8px;
}

.platform-pill {
    flex: 1;
    min-width: 180px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-pill:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.pill-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.pill-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.pill-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    padding: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* Data Tables */
.table-card {
    padding: 24px;
}

.table-header {
    margin-bottom: 16px;
}

.table-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 13px;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.table-media-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
}

.account-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-cell img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Account Cards Grid (Tab 2 & Tab 3) */
.section-banner {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.banner-content h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.banner-content p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.account-card {
    padding: 20px;
    position: relative;
}

.acc-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.acc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.acc-meta {
    flex: 1;
}

.acc-display-name {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
}

.acc-handle {
    color: var(--text-muted);
    font-size: 12px;
}

.acc-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    text-align: center;
    margin-bottom: 16px;
}

.acc-stat-box label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.acc-stat-box span {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
}

.acc-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* Filter Bar (Tab 3) */
.platform-filter-bar {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.filter-label {
    font-weight: 600;
    color: var(--text-muted);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Composer Layout (Tab 4) */
.composer-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
}

.composer-form-card {
    padding: 28px;
}

.form-header {
    margin-bottom: 24px;
}

.form-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: #fff;
    font-family: var(--font-body);
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Target Accounts Multi-Checkboxes */
.target-accounts-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.target-account-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    user-select: none;
}

.target-account-chip input[type="checkbox"] {
    accent-color: var(--primary);
}

.composer-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.scheduled-queue-box {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.scheduled-queue-box h4 {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.queue-list {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.queue-list::-webkit-scrollbar {
    width: 6px;
}

.queue-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 8px;
}

/* Live Preview Mockups (Right Side) */
.composer-preview-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.preview-selector {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 8px;
}

.preview-tab {
    padding: 6px 10px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.preview-tab.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.preview-body {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10px;
}

/* Mockup Containers */
.mockup-container {
    width: 100%;
    max-width: 360px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.mockup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #121212;
}

.mockup-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.mockup-author {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.mockup-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    background: #222;
}

.mockup-actions-bar {
    display: flex;
    gap: 16px;
    padding: 10px 14px;
    font-size: 18px;
    color: #fff;
}

.mockup-caption-box {
    padding: 0 14px 14px 14px;
    font-size: 13px;
    color: #ddd;
    line-height: 1.4;
    word-break: break-word;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    padding: 28px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.modal-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: #A5B4FC;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

/* White Calendar Picker Icon for dark theme */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.85;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.toast {
    padding: 12px 18px;
    border-radius: 10px;
    background: #1E2235;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease;
}

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

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
    .composer-layout { grid-template-columns: 1fr; }
    .sidebar { width: 80px; padding: 20px 10px; }
    .brand-text, .nav-item span, .user-info { display: none; }
    .main-content { margin-left: 80px; padding: 20px; }
}
