:root {
    --bg-dark: #0b0f19;
    --bg-surface: rgba(18, 24, 38, 0.7);
    --bg-surface-hover: rgba(30, 41, 62, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(0, 242, 254, 0.3);
    --primary: #00f2fe;
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --accent: #ff007a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-soft: 0 12px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Ambient Orbs */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.25;
}

.glow-top {
    width: 500px;
    height: 500px;
    background: #00f2fe;
    top: -150px;
    right: -100px;
}

.glow-bottom {
    width: 600px;
    height: 600px;
    background: #ff007a;
    bottom: -200px;
    left: -150px;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.hidden {
    display: none !important;
}

/* Auth / Login */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 10;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    text-align: center;
}

.brand-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 242, 254, 0.12);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: var(--primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.brand-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-hint {
    margin-top: 24px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    color: #fbbf24;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
}

/* Inputs & Form */
.form-layout {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="datetime-local"],
select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-container input {
    padding-right: 44px;
}

.btn-icon {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-gradient);
    color: #030a16;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 14px 0 rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(0, 242, 254, 0.45);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    margin: 20px 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-glow {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--primary-gradient);
    box-shadow: 0 0 16px var(--primary);
}

.brand-title {
    font-weight: 800;
    font-size: 18px;
}

.brand-tag {
    margin-left: 8px;
    padding: 3px 8px;
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.api-endpoint-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.api-endpoint-badge code {
    color: var(--primary);
    font-family: monospace;
    font-weight: bold;
}

.dot-live {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

.btn-copy {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
}

.btn-copy:hover {
    color: #fff;
}

/* Dashboard Container */
.main-container {
    padding: 0 32px 40px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.stat-desc {
    font-size: 12px;
    color: #64748b;
}

.text-success { color: var(--success); }
.text-highlight { color: var(--primary); }

/* Toolbar */
.toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.toolbar-header h2 {
    font-size: 20px;
    font-weight: 700;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.campaigns-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.campaigns-table th {
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.campaigns-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    font-size: 14px;
}

.campaigns-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Media Thumbnail Preview */
.media-thumb {
    width: 80px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    background: #030712;
    border: 1px solid var(--border-color);
    display: block;
    cursor: pointer;
}

.badge-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
}

.type-image { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.type-gif { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.type-video { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-inactive { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.status-expired { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-table-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: #e2e8f0;
}

.btn-table-action:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-table-action.btn-del:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: #fca5a5;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}

.preview-modal-card {
    max-width: 720px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

/* Resource Tabs & Dropzone */
.resource-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.tab-btn {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.tab-btn.active {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.file-dropzone {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: rgba(0, 242, 254, 0.02);
}

.file-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dropzone-icon {
    font-size: 28px;
}

.dropzone-text {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}

.dropzone-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: #1e293b;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    color: #fff;
    animation: slideIn 0.3s ease forwards;
}

.toast-success { border-color: var(--success); color: #34d399; }
.toast-error { border-color: var(--danger); color: #f87171; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar { margin: 10px; padding: 14px; flex-direction: column; gap: 12px; }
    .main-container { padding: 0 10px 30px; }
    .form-row { flex-direction: column; gap: 12px; }
}
