body {
    font-family: 'Inter', sans-serif;
    background-color: #111111;
    color: white;
}

.glass-nav {
    background: rgba(17, 17, 17, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.input-glow:focus-within {
    box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.5), 0 0 20px rgba(192, 132, 252, 0.3);
    border-color: #c084fc;
}

.input-active-glow {
    box-shadow: 0 0 25px rgba(192, 132, 252, 0.3);
}

.input-mode-btn {
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
}

.input-mode-btn:hover {
    color: #d1d5db;
}

.input-mode-btn.active {
    color: #ffffff;
    background: rgba(192, 132, 252, 0.25);
}

svg[role="button"][tabindex="0"]:focus-visible {
    outline: 2px solid rgba(196, 181, 253, 0.95);
    outline-offset: 3px;
    border-radius: 0.375rem;
}

#pull-content-btn,
#generate-btn {
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.25), 0 12px 28px rgba(168, 85, 247, 0.5);
}

#pull-content-btn:hover,
#generate-btn:hover {
    box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.5), 0 16px 34px rgba(168, 85, 247, 0.58);
}

#pull-content-btn:focus-visible,
#generate-btn:focus-visible {
    outline: 2px solid rgba(196, 181, 253, 0.95);
    outline-offset: 2px;
}

.code-window {
    background-color: #0d0d0d;
    border: 1px solid #333;
}

/* Output editor ergonomics */
#view-raw-btn,
#view-preview-btn {
    min-height: 2.25rem;
    min-width: 4.75rem;
    padding: 0.5rem 0.9rem !important;
    border-radius: 0.5rem;
    font-size: 0.85rem !important;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
}

#copy-btn,
#fullscreen-btn {
    min-height: 2.25rem;
    min-width: 2.25rem;
    border-radius: 0.5rem;
    padding: 0.35rem 0.55rem;
}

#copy-btn:hover,
#fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.07);
}

#view-raw-btn:focus-visible,
#view-preview-btn:focus-visible,
#copy-btn:focus-visible,
#fullscreen-btn:focus-visible {
    outline: 2px solid rgba(192, 132, 252, 0.75);
    outline-offset: 2px;
}

#md-toolbar .md-tool-btn {
    min-height: 1.95rem;
    min-width: 1.95rem;
}

#output-code,
#preview-view {
    line-height: 1.7;
    font-size: 0.96rem;
}

/* Adaptive output panel height (avoid large empty space for short content) */
.code-window .code-content-area {
    height: auto !important;
    min-height: 16rem;
    max-height: min(72vh, 46rem);
    overflow: hidden;
}

.code-window #output-code,
.code-window #preview-view {
    height: auto !important;
    min-height: 13rem;
    max-height: calc(min(72vh, 46rem) - 3rem);
    overflow-y: auto;
}

@media (min-width: 1024px) {

    #view-raw-btn,
    #view-preview-btn {
        min-width: 5.25rem;
        font-size: 0.9rem !important;
    }

    #output-code,
    #preview-view {
        font-size: 1rem;
    }

    .code-window .code-content-area {
        min-height: 20rem;
    }

    .code-window #output-code,
    .code-window #preview-view {
        min-height: 17rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 13, 13, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Hourglass Animation */
.hourglass-spin {
    animation: hourglass 2s infinite ease-in-out;
}

@keyframes hourglass {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(180deg);
    }
}

/* Progress Bar Animation */
.progress-bar {
    width: 0%;
    transition: width 0.2s linear;
}

/* Security Modal */
#security-modal.active {
    opacity: 1;
    pointer-events: all;
}

#security-modal.active>div {
    transform: scale(1);
}

/* Full Screen Code Window */
.code-window.fullscreen {
    position: fixed;
    inset: 10%;
    z-index: 100;
    border-radius: 0.75rem;
    max-width: none;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 100vmax rgba(0, 0, 0, 0.85);
}

.code-window.fullscreen .code-content-area {
    flex-grow: 1;
    height: 0 !important;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.code-window.fullscreen #output-code,
.code-window.fullscreen #preview-view {
    height: 100% !important;
    max-height: none !important;
    flex-grow: 1;
}

/* Toggle Switch */
.toggle-checkbox:checked {
    right: 0;
    border-color: #c084fc;
}

.toggle-checkbox:checked+.toggle-label {
    background-color: #c084fc;
}
