:root {
    --bg-dark: #090d16;
    --bg-card: rgba(20, 26, 40, 0.6);
    --bg-sidebar: #05080f;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.2);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(99, 102, 241, 0.3);
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Sidebar and Main Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.925rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: var(--text-light);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.02) 100%);
    border-left: 3px solid var(--primary);
    padding-left: calc(1rem - 3px);
    box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.05);
}

.sidebar-link i {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.sidebar-link:hover i {
    transform: scale(1.08);
}

.main-content {
    flex-grow: 1;
    margin-left: 260px;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: transparent;
    color: var(--text-light);
    font-weight: 500;
}

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

.btn-outline-primary {
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.5);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
}

/* Forms */
.form-control, .form-select {
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: #475569;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    color: var(--text-light);
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

/* Tables */
.table {
    color: var(--text-light);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.02);
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom-width: 1px;
}

/* Badges */
.badge {
    padding: 0.4em 0.75em;
    font-weight: 600;
    border-radius: 2rem;
}

.text-bg-light {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-light) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-bg-secondary {
    background-color: rgba(148, 163, 184, 0.12) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.text-bg-info {
    background-color: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.text-bg-warning {
    background-color: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.text-bg-success {
    background-color: rgba(16, 185, 129, 0.12) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.text-bg-primary {
    background-color: rgba(99, 102, 241, 0.12) !important;
    color: #818cf8 !important;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Welcome Page Hero Illustration & Layout */
.hero-gradient {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
}

.hero-gradient-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    left: -150px;
    z-index: -1;
    pointer-events: none;
}

/* Floating Toolbar */
.floating-canvas-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-canvas-toolbar button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.floating-canvas-toolbar button:hover, .floating-canvas-toolbar button.active {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.08);
}

.floating-canvas-toolbar .divider {
    width: 1px;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.25rem;
}

.floating-canvas-toolbar input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
}

.floating-canvas-toolbar input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.floating-canvas-toolbar input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
}

/* Skeleton Loading Effects */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
}

.editor-skeleton {
    height: 100%;
    width: 100%;
    border-radius: 0.5rem;
}

/* Template Picker star & cards */
.tpl-card {
    border: 1px solid var(--border-color);
    background: rgba(20, 26, 40, 0.4) !important;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.tpl-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.15);
}

.tpl-card.selected {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow), 0 10px 20px -5px rgba(99, 102, 241, 0.2);
}

.fav-star {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.15s ease;
}

.fav-star:hover {
    transform: scale(1.1);
    color: #fbbf24;
}

/* Brand Kit Color Swatches */
.brand-color-swatch {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: transform 0.15s ease;
}
.brand-color-swatch:hover {
    transform: scale(1.1);
}

.text-indigo {
    color: var(--primary) !important;
}

.btn-indigo {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.btn-indigo:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

