/* ============================================
   DOMIZILIX DESIGN SYSTEM v2.0
   Inspired by: Firefox Aurora / Purple-Orange Gradient
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Background */
    --bg-deep: #1a0a2e;
    --bg-surface: #231244;
    --bg-elevated: #2d1b69;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-solid: #2a1854;
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --bg-input: rgba(255, 255, 255, 0.08);
    --bg-input-focus: rgba(255, 255, 255, 0.12);

    /* Borders */
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-accent: rgba(168, 85, 247, 0.4);

    /* Text */
    --text: #f0e6ff;
    --text-bright: #ffffff;
    --text-muted: #b8a4d6;
    --text-dim: #8b74b8;

    /* Accent Colors */
    --purple: #a855f7;
    --purple-light: #c084fc;
    --orange: #f97316;
    --orange-light: #fb923c;
    --pink: #ec4899;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #3b82f6;
    --cyan: #06b6d4;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #ec4899 0%, #f97316 50%, #fbbf24 100%);
    --gradient-accent: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --gradient-btn: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
    --gradient-btn-warm: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #fbbf24 100%);
    --gradient-surface: linear-gradient(180deg, #1a0a2e 0%, #231244 100%);
    --gradient-card-glow: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow-purple: 0 0 30px rgba(168, 85, 247, 0.2);
    --shadow-glow-orange: 0 0 30px rgba(249, 115, 22, 0.2);

    /* Radius */
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;

    /* Fonts */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* --- Base Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* --- Gradient Text Helper --- */
.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow-purple);
}

/* --- Light Card (white-ish on dark like Firefox) --- */
.light-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    color: #1a0a2e;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.light-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-purple);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--gradient-btn);
    border: none;
    border-radius: var(--radius-pill);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
    filter: brightness(1.1);
}

.btn-warm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--gradient-btn-warm);
    border: none;
    border-radius: var(--radius-pill);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.btn-warm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
    filter: brightness(1.1);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

/* --- Form Inputs (shared) --- */
.dx-input, .dx-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-bright);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: all 0.2s ease;
}

.dx-input:focus, .dx-select:focus {
    border-color: var(--purple);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.dx-input::placeholder { color: var(--text-dim); }

.dx-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Badges --- */
.dx-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dx-badge-entwurf { background: rgba(249, 115, 22, 0.15); color: var(--orange); border: 1px solid rgba(249, 115, 22, 0.3); }
.dx-badge-review { background: rgba(59, 130, 246, 0.15); color: var(--blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.dx-badge-freigegeben { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.dx-badge-storno { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.dx-badge-ki { background: rgba(168, 85, 247, 0.15); color: var(--purple-light); border: 1px solid rgba(168, 85, 247, 0.3); }

/* --- Tables (dark theme) --- */
.dx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dx-table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

.dx-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.dx-table tbody tr:hover td {
    background: rgba(168, 85, 247, 0.06);
}

.dx-table tbody tr { cursor: pointer; }

.dx-table .r { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Modal / Dialog --- */
.dx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 5, 20, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dx-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), var(--shadow-glow-purple);
}

.dx-modal h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-bright);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168, 85, 247, 0.5); }

/* --- Utility --- */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.neg { color: var(--red); }
.pos { color: var(--green); }

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.2); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.4); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- App Icon Containers (for dashboard tiles) --- */
.app-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    position: relative;
}

.app-icon-wrap.purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.3));
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15);
}

.app-icon-wrap.orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.3));
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.15);
}

.app-icon-wrap.pink {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(219, 39, 119, 0.3));
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.15);
}

.app-icon-wrap.cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(8, 145, 178, 0.3));
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.15);
}

.app-icon-wrap.green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.3));
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.15);
}

/* --- Alert / Toast --- */
.dx-alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.dx-alert.visible { display: block; }
.dx-alert-success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.25); color: #86efac; }
.dx-alert-error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.25); color: #fca5a5; }

/* --- Spinner --- */
.dx-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
