:root {
    --ued-bg: #f5f7fb;
    --ued-surface: #ffffff;
    --ued-surface-soft: #f0f4ff;
    --ued-border: #d6deeb;
    --ued-text: #0f172a;
    --ued-text-secondary: #475569;
    --ued-primary: #2563eb;
    --ued-primary-soft: rgba(37, 99, 235, 0.12);
    --ued-primary-contrast: #ffffff;
    --ued-shadow: 0 20px 40px -20px rgba(37, 99, 235, 0.45);
}

body[data-theme="dark"] {
    --ued-bg: #0f172a;
    --ued-surface: #111c3d;
    --ued-surface-soft: #152349;
    --ued-border: rgba(148, 163, 184, 0.3);
    --ued-text: #e2e8f0;
    --ued-text-secondary: #cbd5f5;
    --ued-primary: #60a5fa;
    --ued-primary-soft: rgba(96, 165, 250, 0.16);
    --ued-primary-contrast: #0f172a;
    --ued-shadow: 0 22px 45px -25px rgba(96, 165, 250, 0.4);
}

body {
    background-color: var(--ued-bg);
    background-image: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 45%);
    color: var(--ued-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
}

.status-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hero {
    background: linear-gradient(130deg, #1d4ed8 0%, #7c3aed 50%, #0ea5e9 100%);
    color: #ffffff;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0.4;
    pointer-events: none;
}

.hero .btn-hero {
    border-radius: 999px;
    padding-inline: 1.75rem;
}

.brand-mark {
    font-size: 1.125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.btn-theme {
    border-radius: 999px;
    padding-inline: 1rem;
    transition: all 0.3s ease;
}

.btn-theme .icon-sun,
.btn-theme .icon-moon {
    display: block;
}

.btn-theme .icon-moon {
    display: none;
}

body[data-theme="dark"] .btn-theme.btn-outline-light {
    color: #0f172a;
    background-color: #ffffff;
    border-color: transparent;
}

body[data-theme="dark"] .btn-theme .icon-sun {
    display: none;
}

body[data-theme="dark"] .btn-theme .icon-moon {
    display: block;
}

.workspace-card,
.info-panel {
    background-color: var(--ued-surface);
    border-radius: 18px;
    box-shadow: var(--ued-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.operation-badges .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.quick-examples .example-chip {
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-examples .example-chip:hover,
.quick-examples .example-chip:focus {
    background-color: var(--ued-primary);
    color: var(--ued-primary-contrast);
}

.accordion-howto .accordion-item {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background-color: var(--ued-surface);
}

.accordion-howto .accordion-button:not(.collapsed) {
    color: #1d4ed8;
    background-color: rgba(37, 99, 235, 0.08);
}

.accordion-howto .accordion-button {
    font-weight: 600;
}

.accordion-howto .accordion-body {
    background-color: var(--ued-surface-soft);
}

#keyboardHints kbd {
    background-color: rgba(15, 23, 42, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

#encodeForm textarea {
    min-height: 240px;
    border-radius: 14px;
    border-color: var(--ued-border);
    background-color: var(--ued-surface-soft);
    resize: vertical;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

#encodeForm textarea:focus {
    border-color: var(--ued-primary);
    box-shadow: 0 0 0 0.2rem var(--ued-primary-soft);
    background-color: var(--ued-surface);
}

.form-select {
    border-radius: 14px;
    border-color: var(--ued-border);
    background-color: var(--ued-surface-soft);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.form-select:focus {
    border-color: var(--ued-primary);
    box-shadow: 0 0 0 0.2rem var(--ued-primary-soft);
    background-color: var(--ued-surface);
}

.btn-custom {
    border-radius: 999px;
    padding-inline: 1.5rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-custom:hover,
.btn-custom:focus {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px -20px rgba(15, 23, 42, 0.4);
}

.btn-outline-primary {
    border-color: var(--ued-primary);
    color: var(--ued-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--ued-primary);
    color: var(--ued-primary-contrast, #ffffff);
}

.btn-outline-secondary {
    border-color: var(--ued-border);
    color: var(--ued-text);
}

body[data-theme="dark"] .btn-outline-secondary {
    color: var(--ued-text-secondary);
}

body[data-theme="dark"] .text-secondary {
    color: var(--ued-text-secondary) !important;
}

.result-panel {
    word-wrap: break-word;
    white-space: pre-wrap;
    background-color: var(--ued-surface-soft);
    border: 1px solid var(--ued-border);
    border-radius: 14px;
    padding: 1.25rem;
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.copy-toast {
    margin-top: 1rem;
    border-radius: 999px;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.copy-toast.success {
    background-color: rgba(22, 163, 74, 0.15);
    color: #15803d;
}

.copy-toast.error {
    background-color: rgba(220, 38, 38, 0.15);
    color: #b91c1c;
}

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

.copy-toast.visually-hidden {
    opacity: 0;
    transform: translateY(8px);
}

.feature-list li {
    padding-block: 0.5rem;
}

.feature-icon {
    font-size: 1.5rem;
}

.about-panel p {
    line-height: 1.5;
}

.site-footer {
    border-top: 1px solid var(--ued-border);
    background-color: var(--ued-surface);
}

.site-footer .btn {
    min-width: 160px;
}

.stego-dropzone {
    border: 2px dashed var(--ued-border);
    border-radius: 18px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background-color: var(--ued-surface-soft);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.stego-dropzone.drag-over {
    border-color: var(--ued-primary);
    background-color: var(--ued-primary-soft);
}

.stego-preview-wrapper {
    border-radius: 18px;
    background-color: var(--ued-surface-soft);
    padding: 1.5rem;
}

.stego-preview {
    max-height: 240px;
    object-fit: contain;
}

.stego-textarea {
    min-height: 200px;
    border-radius: 14px;
    border-color: var(--ued-border);
    background-color: var(--ued-surface-soft);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.stego-textarea:focus {
    border-color: var(--ued-primary);
    box-shadow: 0 0 0 0.2rem var(--ued-primary-soft);
    background-color: var(--ued-surface);
}

.stego-progress {
    border-radius: 999px;
    height: 0.65rem;
    background-color: rgba(148, 163, 184, 0.25);
    overflow: hidden;
}

.stego-progress .progress-bar {
    width: 0%;
    transition: width 0.3s ease;
}

.stego-tabs .nav-link {
    border-radius: 999px;
    padding-inline: 1.5rem;
    font-weight: 600;
}

.stego-result .alert {
    border-radius: 16px;
}

@media (max-width: 991.98px) {
    .buttons-group {
        justify-content: flex-start !important;
    }
}

@media (max-width: 767.98px) {
    .hero {
        text-align: center;
    }

    .buttons-group {
        width: 100%;
    }

    .buttons-group .btn {
        flex: 1 1 100%;
    }

    .btn-theme {
        margin-inline: auto;
    }

    #encodeForm textarea {
        min-height: 200px;
    }

    .stego-preview {
        max-height: 200px;
    }
}

.analytics-debug {
    background-color: var(--ued-bg);
}

.analytics-debug__details {
    max-height: 24rem;
    overflow-y: auto;
}

.analytics-debug__payload {
    background-color: rgba(15, 23, 42, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 8rem;
    overflow: auto;
    font-size: 0.8rem;
}
