@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Light Theme variables */
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-rgb: 79, 70, 229;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: #1e293b;
    --sidebar-active-text: #ffffff;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --input-bg: #ffffff;
}

[data-theme="dark"] {
    /* Dark Theme variables */
    --bg-primary: #0b0f19;
    --bg-card: #151c2c;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #222d42;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-rgb: 99, 102, 241;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #22d3ee;
    --sidebar-bg: #0d121f;
    --sidebar-text: #64748b;
    --sidebar-active-bg: #151c2c;
    --sidebar-active-text: #6366f1;
    --card-shadow: 0 4px 20px 0 rgb(0 0 0 / 0.35);
    --input-bg: #1d2639;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* Glassmorphism card utilities */
.card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}
.card-glass:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
}

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

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar .brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.sidebar-menu li.active a {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-menu li a i {
    font-size: 1.15rem;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.content-body {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Custom form styles */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
    color: var(--text-primary);
}

.btn-primary {
    background-color: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Interactive theme toggle button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Dashboard Widgets */
.stat-widget {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Responsive utilities */
@media (max-width: 992px) {
    .sidebar {
        margin-left: -260px;
        position: absolute;
        height: 100%;
    }
    .sidebar.active {
        margin-left: 0;
    }
    .main-header {
        padding: 15px;
    }
    .content-body {
        padding: 15px;
    }
}

/* Invoice form builder items list */
.invoice-item-row {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.ad-placeholder {
    transition: opacity 0.3s ease;
}
