/* Modern Glassmorphic Dark UI Theme - Fully Polished */
:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(18, 26, 43, 0.85);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-modal: #0f172a;
    --bg-input: #1e293b;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-emerald: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --font-family: 'Plus Jakarta Sans', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--bg-card-border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--bg-card-border);
    margin-bottom: 20px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

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

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: white;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.05));
    border-left: 3px solid var(--primary);
}

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

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--accent-emerald);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald);
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.topbar h1 {
    font-size: 24px;
    font-weight: 700;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary {
    background: var(--secondary);
    color: var(--text-main);
    border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: var(--accent-emerald);
    color: white;
}

.btn-danger {
    background: var(--accent-rose);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.icon-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

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

.stat-value {
    font-size: 22px;
    font-weight: 700;
}

/* Cards & Layout */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 12px;
}

.tab-item {
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-item:hover, .tab-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.tab-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--bg-card-border);
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-card-border);
    font-size: 13px;
}

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

.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-emerald { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.badge-rose { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.badge-insta { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.badge-yt { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.badge-tiktok { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-active { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-paused { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

.modal-lg { max-width: 820px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-card-border);
}

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

.modal-close {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: white;
}

/* Form Controls & Dropdowns */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Custom Styled Select Dropdown */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-input);
    color: var(--text-main);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22293.4%22%20height%3D%22293.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M236.4%20129.1L146.7%20218.8%2057%20129.1c-4.7-4.7-12.3-4.7-17%200s-4.7%2012.3%200%2017l98.2%2098.2c4.7%204.7%2012.3%204.7%2017%200l98.2-98.2c4.7-4.7%204.7-12.3%200-17s-12.3-4.7-17%200z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px;
    padding-right: 36px;
    height: 42px;
    cursor: pointer;
}

select.form-control option {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 10px;
}

/* Hours Grid Styling */
.hours-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    background: #090e17;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    max-height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
}

.hour-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

.hour-chip:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

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

.code-box {
    background: #020617;
    border: 1px solid var(--bg-card-border);
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 12px;
    color: var(--accent-emerald);
    word-break: break-all;
    margin: 12px 0;
}

.alert {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--accent-emerald); color: #6ee7b7; }
.alert-danger { background: rgba(244, 63, 94, 0.15); border: 1px solid var(--accent-rose); color: #fda4af; }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.row { display: flex; gap: 16px; }
.col-6 { flex: 1; }
.col-8 { flex: 2; }
.col-4 { flex: 1; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mt-3 { margin-top: 12px !important; }

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
