body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    background-color: #020617;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
    border: 1px solid #0f172a;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

textarea::-webkit-scrollbar {
    width: 10px;
}

textarea::-webkit-scrollbar-track {
    background: transparent;
}

textarea::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
    border: 1px solid #0f172a;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #475569;
}


/* Transitions */
.sidebar-transition {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotate-icon {
    transition: transform 0.3s ease;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Styles - Surface Look */
textarea {
    resize: vertical;
    outline: none;
    background-color: #0f172a;
    /* Slate 900 - hebt sich vom Hintergrund ab */
    border: 1px solid #1e293b;
    /* Slate 800 */
    color: #f1f5f9;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

textarea:focus {
    background-color: #0f172a;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px #38bdf8, 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Toggle Button Style */
.splitter-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 48px;
    background-color: #0f172a;
    /* Match Sidebar */
    border: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    color: #64748b;
    transition: all 0.2s;
}

.splitter-toggle:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    background-color: #1e293b;
}

.nav-item .nav-indicator {
    opacity: 0;
}

.nav-item.active-nav .nav-indicator {
    opacity: 1;
}

.nav-item.active-nav {
    background-color: #1e293b;
    /* Slate 800 */
    color: white;
}

:root {
    --navy-deep: #020617;
    --navy-sidebar: #0f172a;
    --navy-border: #1e293b;
    --brand-sky: #0ea5e9;
    --brand-hover: #38bdf8;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --sidebar-w: 16rem;
    --sidebar-w-collapsed: 4rem;
    --sidebar-current-w: var(--sidebar-w);
}

/* --- Driver.js Dark Theme Overrides --- */
.driver-popover {
    background-color: #0f172a !important;
    /* var(--navy-sidebar) */
    color: #94a3b8 !important;
    /* var(--muted) */
    border: 1px solid #1e293b !important;
    /* var(--navy-border) */
    border-radius: 0.5rem !important;
}

.driver-popover-title {
    color: #ffffff !important;
    font-size: 1.125rem !important;
    font-weight: bold !important;
    margin-bottom: 0.5rem !important;
}

.driver-popover-description {
    color: #94a3b8 !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
}

.driver-popover-footer {
    margin-top: 1rem !important;
}

.driver-popover-footer button {
    background-color: transparent !important;
    border: 1px solid #1e293b !important;
    color: #e2e8f0 !important;
    text-shadow: none !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
}

.driver-popover-footer button:hover {
    background-color: #1e293b !important;
}

.driver-popover-footer .driver-popover-next-btn {
    background-color: #0ea5e9 !important;
    /* var(--brand-sky) */
    border-color: #0ea5e9 !important;
    color: #020617 !important;
    /* var(--navy-deep) */
}

.driver-popover-footer .driver-popover-next-btn:hover {
    background-color: #38bdf8 !important;
    /* var(--brand-hover) */
    border-color: #38bdf8 !important;
}

.driver-popover-close-btn {
    color: #94a3b8 !important;
}

.driver-popover-close-btn:hover {
    color: #ffffff !important;
}

/* Arrows */
.driver-popover .driver-popover-arrow-side-top {
    border-bottom-color: #0f172a !important;
}

.driver-popover .driver-popover-arrow-side-bottom {
    border-top-color: #0f172a !important;
}

.driver-popover .driver-popover-arrow-side-left {
    border-right-color: #0f172a !important;
}

.driver-popover .driver-popover-arrow-side-right {
    border-left-color: #0f172a !important;
}

.driver-popover-description strong,
.driver-popover-description b,
#onboarding-text strong,
#onboarding-text b {
    color: #ffffff;
}

body.sidebar-collapsed {
    --sidebar-current-w: var(--sidebar-w-collapsed);
}

#sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-current-w);
}

#header-spacer-left {
    width: var(--sidebar-current-w);
}

#app-body {
    margin-left: var(--sidebar-current-w);
    transition: margin-left .3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar-inner {
    padding-top: 0;
    height: auto;
    min-height: 0;
}

#sidebar-library {
    min-height: 0;
}

body.sidebar-collapsed #sidebar-topbar {
    justify-content: center;
}

body.sidebar-collapsed #sidebar-left .nav-label {
    display: none;
}

body.sidebar-collapsed #sidebar-left .sidebar-nav-title {
    display: none;
}

body.sidebar-collapsed #sidebar-library {
    display: none;
}

body.sidebar-collapsed #sidebar-left .nav-item {
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed #sidebar-left .nav-item i {
    margin: 0;
}

body.sidebar-collapsed #sidebar-left .sidebar-user-text {
    display: none;
}

.ui-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .80);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ui-modal {
    background: var(--navy-sidebar);
    border: 1px solid var(--navy-border);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .45);
    padding: 24px;
    width: 100%;
}

.ui-modal-sm {
    max-width: 24rem;
}

.ui-modal-lg {
    max-width: 32rem;
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ui-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.ui-icon-btn {
    color: #64748b;
    transition: color .15s ease, background .15s ease, transform .15s ease;
    border-radius: 8px;
    padding: 6px;
}

.ui-icon-btn:hover {
    color: #fff;
    background: rgba(30, 41, 59, .40);
}

.ui-icon-btn:active {
    transform: scale(.98);
}

.ui-label {
    font-size: .75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.ui-input,
.ui-select,
.ui-textarea {
    width: 100%;
    margin-top: 8px;
    border-radius: 10px;
    padding: 12px;
    background: var(--navy-deep);
    border: 1px solid var(--navy-border);
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ui-textarea {
    min-height: 120px;
    resize: vertical;
}

.ui-input:focus,
.ui-select:focus,
.ui-textarea:focus {
    border-color: var(--brand-sky);
    box-shadow: 0 0 0 1px var(--brand-sky);
}

.ui-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 700;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    user-select: none;
}

.ui-btn:active {
    transform: scale(.98);
}

.ui-btn-ghost {
    color: var(--muted);
    background: transparent;
}

.ui-btn-ghost:hover {
    color: #fff;
}

.ui-btn-primary {
    background: var(--brand-sky);
    color: var(--navy-deep);
    box-shadow: 0 0 20px -5px rgba(56, 189, 248, .30);
}

.ui-btn-primary:hover {
    background: var(--brand-hover);
}

.ui-btn-danger {
    background: #ef4444;
    color: #fff;
}

.ui-btn-danger:hover {
    background: #dc2626;
}

#input-free {
    font-family: 'Inter', sans-serif;
    white-space: pre-wrap;
    outline: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#input-free:empty:before {
    content: attr(data-placeholder);
    color: #64748b;
}

#input-free h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

#input-free h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

#input-free h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

#input-free ul {
    list-style: disc;
    padding-left: 1.5rem;
}

#input-free ol {
    list-style: decimal;
    padding-left: 1.5rem;
}

#input-free li {
    margin: 0.15rem 0;
}

#input-free code,
#input-free pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background-color: rgba(30, 41, 59, 0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #38bdf8;
    font-size: 0.9em;
    white-space: pre-wrap;
    word-break: break-all;
}

#input-free pre {
    display: block;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

#input-free blockquote {
    font-style: italic;
    border-left: 3px solid rgba(148, 163, 184, 0.5);
    padding-left: 0.75rem;
    color: #cbd5f5;
    margin: 6px 0;
}

.hidden {
    display: none !important;
}

/* Cookiebot Overlay Fix */
#CookiebotWidget {
    display: none !important;
}

/* Toast-Meldungen (ersetzen alert()-Popups) */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    max-width: min(90vw, 28rem);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-error { border-color: rgba(248, 113, 113, 0.5); }
.toast-success { border-color: rgba(74, 222, 128, 0.5); }
.toast-info { border-color: rgba(56, 189, 248, 0.5); }
