
/* Design Tokens */
:root {
    /* Gold core */
    --primary: #d4af37;        /* Classic gold */
    --primary-600: #c39a2d;     /* Slightly deeper */
    --primary-dark: #b8860b;    /* Dark gold for hovers & accents */
    --secondary: #c9a961;       /* Desaturated gold */

    /* Support */
    --success: #27ae60;
    --warning: #f1c40f;
    --danger: #e74c3c;

    /* Surfaces & Text for dark UI */
    --bg: #0b0f14;              /* app background */
    --panel: #0f141b;           /* cards/panels */
    --panel-2: #121923;         /* subtle raised panels */
    --stroke: #1e2a36;          /* base border */
    --stroke-gold: rgba(212, 175, 55, .25);

    --text: #e6e9ef;            /* primary text */
    --muted: #aab2bf;           /* secondary text */

    /* Backward-compat mapping (to not break existing rules) */
    --dark: var(--text);
    --light: var(--panel);
    --white: var(--panel);

    /* Elevation */
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
    --ring: 0 0 0 3px rgba(212, 175, 55, .15);
}

/* App Background with luxe vignette */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 15% 0%, rgba(212,175,55,.08), transparent 60%),
        radial-gradient(900px 500px at 85% 100%, rgba(184,134,11,.10), transparent 55%),
        linear-gradient(135deg, #0a0e13 0%, #0d1218 60%, #0b0f14 100%);
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.app-header {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    padding: 1.25rem 1.75rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--stroke);
    outline: 1px solid var(--stroke-gold);
    outline-offset: -1px;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .3px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: 0 0 18px rgba(212,175,55,.25);
}

/* User info */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
}

/* Main */
.main-content {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border-radius: 16px;
    padding: 2rem;
    min-height: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--stroke);
    outline: 1px solid var(--stroke-gold);
    outline-offset: -1px;
}

/* Login */
.login-container {
    max-width: 440px;
    margin: 8rem auto;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)),
                var(--panel);
    padding: 2.5rem;
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--stroke);
    outline: 1px solid var(--stroke-gold);
    outline-offset: -1px;
    backdrop-filter: blur(6px);
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--muted);
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    background: #0c1218;
    color: var(--text);
    border: 2px solid var(--stroke);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.25s ease;
}

input::placeholder, textarea::placeholder { color: #7f8896; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: var(--ring);
    background: #0e151d;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.4rem;
    border: none;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    will-change: transform;
}

.btn:active { transform: translateY(0); }

.btn-primary {
    color: #0b0f14;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 8px 24px rgba(212,175,55,.28), inset 0 0 0 1px rgba(0,0,0,.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(212,175,55,.35);
    filter: saturate(110%);
}

.btn-secondary {
    background: linear-gradient(135deg, #1a2431, #121a23);
    color: var(--text);
    border: 1px solid var(--stroke);
}

.btn-secondary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-success { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #0b0f14; }
.btn-danger  { background: linear-gradient(135deg, #ff6b6b, #e74c3c); color: #0b0f14; }
.btn-warning { background: linear-gradient(135deg, #f6d365, #f1c40f); color: #0b0f14; }

.btn-sm { padding: 0.55rem 0.9rem; font-size: 0.9rem; border-radius: 10px; }

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.9rem 1.2rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #8c96a6;
    cursor: pointer;
    position: relative;
    transition: color .2s ease, transform .15s ease;
    border-radius: 10px 10px 0 0;
}

.tab:hover { color: var(--text); transform: translateY(-1px); }

.tab.active { color: var(--primary); }

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 12px rgba(212,175,55,.5);
    border-radius: 2px;
}

/* Grid helpers */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* Cards */
.card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--stroke);
    outline: 1px solid transparent;
    border-radius: 14px;
    padding: 1.25rem;
    transition: transform .2s ease, box-shadow .2s ease, outline-color .2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    outline-color: var(--stroke-gold);
}

/* Stat cards */
.stat-card {
    background: linear-gradient(135deg, rgba(212,175,55,.14), rgba(184,134,11,.10));
    color: var(--text);
    padding: 1.5rem;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--stroke-gold);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212,175,55,0.18) 0%, transparent 60%);
}

.stat-value {
    font-size: 2.1rem;
    font-weight: 900;
    margin-bottom: 0.35rem;
    color: var(--primary);
    text-shadow: 0 0 18px rgba(212,175,55,.25);
}

.stat-label { color: var(--muted); font-weight: 600; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
    background: #121923;
    color: var(--muted);
    padding: 0.85rem;
    text-align: left;
    font-weight: 800;
    letter-spacing: .2px;
    border-bottom: 1px solid var(--stroke);
}

.table td {
    padding: 0.85rem;
    border-top: 1px solid var(--stroke);
    color: var(--text);
}

.table tr:hover { background: rgba(255,255,255,.02); }

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 800;
    display: inline-block;
    border: 1px solid var(--stroke);
    background: #0e141a;
    color: var(--text);
}

.badge-success { background: rgba(46, 204, 113, .15); color: #7ee2a8; border-color: rgba(46, 204, 113, .25); }
.badge-warning { background: rgba(241, 196, 15, .15); color: #f5da6a; border-color: rgba(241, 196, 15, .25); }
.badge-danger  { background: rgba(231, 76, 60, .15); color: #ff9c8f; border-color: rgba(231, 76, 60, .25); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    animation: fadeIn .25s both;
    backdrop-filter: blur(3px);
}

.modal.active { display: flex; align-items: center; justify-content: center; }

.modal-content {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    padding: 2rem;
    border-radius: 16px;
    max-width: 700px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .25s ease;
    box-shadow: var(--shadow);
    border: 1px solid var(--stroke);
    outline: 1px solid var(--stroke-gold);
    outline-offset: -1px;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Questions & Options */
.question-card {
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)), var(--panel);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--stroke);
}

.option {
    display: flex;
    align-items: center;
    padding: 0.85rem;
    margin: 0.55rem 0;
    background: #0c1218;
    border: 2px solid var(--stroke);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.option:hover {
    border-color: var(--primary-600);
    background: #0e151d;
    box-shadow: 0 0 0 3px rgba(212,175,55,.08);
}

.option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(212,175,55,.12), rgba(184,134,11,.10));
    box-shadow: 0 0 0 4px rgba(212,175,55,.12);
}

.option input[type="radio"],
.option input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    accent-color: var(--primary);
}

/* Timer */
.timer {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--primary);
    z-index: 100;
    border: 1px solid var(--stroke);
    outline: 1px solid var(--stroke-gold);
    outline-offset: -1px;
}

.timer.warning { color: var(--warning); animation: pulse 1s infinite; }
.timer.danger  { color: var(--danger);  animation: pulse 0.6s infinite; }

/* Progress */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #0d131a;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--stroke);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 999px;
    transition: width 0.3s;
    box-shadow: 0 8px 20px rgba(212,175,55,.25);
}

/* Empty */
.empty-state { text-align: center; padding: 3rem; color: var(--muted); }
.empty-state svg { width: 100px; height: 100px; margin-bottom: 1rem; opacity: 0.35; }

/* Actions */
.actions { display: flex; gap: 0.5rem; }

/* Editors */
.question-editor {
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)), var(--panel);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid var(--stroke);
}

.option-editor {
    display: grid;
    grid-template-columns: auto 1fr auto; /* Radio/Checkbox | Textfeld | X-Button */
    align-items: center;
    column-gap: .5rem;
    margin-bottom: 0.5rem;
}

.option-editor input[type="radio"],
.option-editor input[type="checkbox"] {
    width: auto;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.option-editor input[type="text"] {
    width: 100%;
    min-width: 0;
    color: var(--text);
    background: #0c1218;
    line-height: 1.4;
    border: 2px solid var(--stroke);
    border-radius: 10px;
    padding: .6rem .75rem;
    transition: all .2s ease;
}

.option-editor input[type="text"]:focus {
    border-color: var(--primary-600);
    box-shadow: var(--ring);
    background: #0e151d;
}

.option-editor .btn { white-space: nowrap; }

.option-editor input[type="text"]::placeholder {
    color: #7f8896;
    opacity: 1;
}

/* Stats overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    .app-header { flex-direction: column; gap: 1rem; }
    .tabs { flex-wrap: wrap; }
    .modal-content { width: 95%; padding: 1.25rem; }
}
