:root {
    --dark-bg: #0b1120;
    --dark-bg-alt: #111827;
    --dark-surface: rgba(17, 24, 39, 0.9);
    --dark-surface-solid: #151f32;
    --dark-surface-muted: #0f172a;
    --dark-border: rgba(148, 163, 184, 0.2);
    --dark-text: #e5e7eb;
    --dark-muted: #94a3b8;
    --dark-primary: #8b5cf6;
    --dark-primary-light: #c4b5fd;
    --dark-cyan: #22d3ee;
    --dark-radius: 18px;
    --dark-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* Page foundation */
html {
    background: var(--dark-bg);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding-bottom: 0;
    overflow-x: hidden;
    color: var(--dark-text);
    background: radial-gradient(circle at 10% 0%, rgba(139, 92, 246, 0.18), transparent 30rem), radial-gradient(circle at 90% 15%, rgba(34, 211, 238, 0.1), transparent 25rem), linear-gradient(145deg, #080d19 0%, var(--dark-bg) 55%, #101827 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.01em;
}

/* Navigation */
header {
    position: relative;
    z-index: 10;
    padding: 1rem 0 0.5rem;
}

    header .container-fluid {
        padding-top: 0 !important;
    }

    header .navbar {
        min-height: 64px;
        padding: 0.1625rem 1rem;
        border: 1px solid var(--dark-border);
        border-radius: 14px !important;
        background: linear-gradient( 135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96) ) !important;
        box-shadow: var(--dark-shadow);
        backdrop-filter: blur(16px);
    }

    header .navbar-brand {
        display: inline-flex;
        align-items: center;
        color: #ffffff !important;
        font-size: 1.1rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        transition: opacity 0.2s ease;
    }

        header .navbar-brand::before {
            content: "✦";
            display: inline-grid;
            width: 30px;
            height: 30px;
            margin-right: 0.55rem;
            place-items: center;
            color: var(--dark-primary-light);
            border: 1px solid rgba(196, 181, 253, 0.25);
            border-radius: 9px;
            background: rgba(139, 92, 246, 0.18);
        }

        header .navbar-brand:hover {
            opacity: 0.82;
        }

    header .nav-link {
        color: var(--dark-muted) !important;
        font-size: 1.1rem !important;
        font-weight: 600;
        transition: color 0.2s ease;
    }

        header .nav-link:hover,
        header .nav-link:focus {
            color: #ffffff !important;
        }

    header .navbar-toggler {
        border-color: var(--dark-border);
    }

    header .dropdown-menu {
        min-width: 240px;
        padding: 0.5rem;
        margin-top: 0.75rem;
        border: 1px solid var(--dark-border);
        border-radius: 12px;
        background: #182337;
        box-shadow: var(--dark-shadow);
    }

    header .dropdown-item {
        padding: 0.65rem 0.8rem;
        border-radius: 8px;
        color: var(--dark-text);
        font-size: 0.92rem;
        transition: color 0.2s ease, background-color 0.2s ease;
    }

        header .dropdown-item:hover,
        header .dropdown-item:focus {
            color: #ffffff;
            background: rgba(139, 92, 246, 0.22);
        }

    header .dropdown-divider {
        margin: 0.35rem 0;
        border-color: var(--dark-border);
    }

/* Main content */
main {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

body > .container {
    flex: 1 0 auto;
    width: 100%;
}

    main > .container {
        max-width: 100%;
        padding: 0;
    }

#divOverlay {
    min-height: 50vh;
}

/* Loading overlay */
#divOverlay > .loadingoverlay {
    z-index: 20 !important;
    border-radius: var(--dark-radius);
    background: rgba(8, 13, 25, 0.84) !important;
    backdrop-filter: blur(6px);
}

#divOverlay .loadingoverlay_text {
    margin-top: 1rem !important;
    color: var(--dark-primary-light) !important;
    font-size: 12rem !important;
    font-weight: 650 !important;
    letter-spacing: 0.01em;
    line-height: 1.1 !important;
    transform: scale(1.35);
    transform-origin: center;
    text-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
}

#divOverlay .loadingoverlay_element {
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.35));
}

main .jumbotron {
    position: relative;
    padding: clamp(0.6rem, 1.6vw, 1.2rem) !important;
    overflow: hidden;
    border: 1px solid var(--dark-border);
    border-radius: var(--dark-radius);
    background: var(--dark-surface);
    box-shadow: var(--dark-shadow);
    backdrop-filter: blur(16px);
}

    main .jumbotron::before {
        position: absolute;
        top: 0;
        right: 0;
        width: 180px;
        height: 180px;
        content: "";
        pointer-events: none;
        background: radial-gradient( circle, rgba(139, 92, 246, 0.16), transparent 70% );
    }

    main .jumbotron h2 {
        position: relative;
        margin-bottom: 1rem;
        color: #ffffff;
        font-size: clamp(1.8rem, 4vw, 2.5rem);
        font-weight: 750;
        letter-spacing: -0.035em;
    }

    main .jumbotron .lead {
        position: relative;
        color: var(--dark-muted);
        line-height: 1.7;
    }

    main .jumbotron hr {
        margin: 1.5rem 0;
        border-color: var(--dark-border);
        opacity: 1;
    }

/* File upload control */
.fileInput {
    min-height: 52px;
    margin-bottom: 1.75rem !important;
    padding: 0.32rem 0.4rem;
    color: var(--dark-muted);
    border: 1px dashed rgba(139, 92, 246, 0.55);
    border-radius: 12px;
    background: var(--dark-surface-muted);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

    .fileInput:hover {
        color: var(--dark-text);
        border-color: var(--dark-cyan);
        background: rgba(34, 211, 238, 0.08);
    }

    .fileInput:focus {
        color: var(--dark-text);
        border-color: var(--dark-primary-light);
        background: var(--dark-surface-muted);
        box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.2);
    }

    .fileInput::file-selector-button {
        margin-right: 0.75rem;
        padding: 0.55rem 0.9rem;
        color: #ffffff;
        border: 0;
        border-radius: 8px;
        background: linear-gradient(135deg, #7c3aed, #4f46e5);
        cursor: pointer;
    }

/* Summary output */
.CEtextareaDoc,
.CEtextarea,
.CEtextareaShort {
    width: 100%;
    padding: 0.4rem 0.44rem;
    overflow-y: auto;
    resize: vertical;
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    background: var(--dark-surface-muted);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
    line-height: 1.65;
}

.CEtextareaDoc {
    display: block;
    min-height: 275px;
}

.CEtextarea {
    min-height: 250px;
}

.CEtextareaShort {
    min-height: 50px;
}

    .CEtextareaDoc:focus,
    .CEtextarea:focus,
    .CEtextareaShort:focus {
        outline: none;
        border-color: var(--dark-primary);
        box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.18);
    }

::placeholder {
    color: #64748b;
}

/* Footer */
body > footer.footer {
    flex-shrink: 0;
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100%;
    margin-top: 0;
    padding: 0.6rem 0;
    min-height: 46px;
    box-sizing: border-box;
    line-height: 1.2 !important;
    white-space: normal !important;
    color: var(--dark-muted) !important;
    border-top: 1px solid var(--dark-border) !important;
    background: rgba(8, 13, 25, 0.55);
}

footer h6 {
    margin: 0;
    font-weight: 500;
    font-size: 0.85rem;
}

footer a {
    color: var(--dark-muted) !important;
    transition: color 0.2s ease, transform 0.2s ease;
}

    footer a:hover {
        color: var(--dark-primary-light) !important;
        transform: translateY(-2px);
    }

/* Existing fixed footer compatibility */
.footerNew {
    position: static;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 40px;
    padding: 0.65rem;
    color: #ffffff;
    text-align: center;
    background: #0f172a;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    border: 2px solid var(--dark-bg);
    border-radius: 999px;
    background: #334155;
}

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

@media (max-width: 767.98px) {
    header {
        padding: 0.65rem 0 0.25rem;
    }

        header .navbar {
            min-height: 58px;
        }

    main {
        padding-top: 1rem;
    }

        main .jumbotron {
            padding: 1.25rem;
            border-radius: 14px;
        }

    footer.footer .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    footer.footer {
        padding: 0.5rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
