/* 
    Project: Express Addon Wizard - Core Styles
    Prefix: addon-
    Last Modified: 2026-04-13
*/

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Monoton&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
    --addon-canvas-rgb: 150, 100, 200;
    --addon-input-bg-color: rgba(var(--addon-canvas-rgb), 0.3);
    --addon-border-color: rgba(var(--addon-canvas-rgb), 0.3);
    --addon-text-main: hsl(270, 20%, 85%);
    --addon-text-header: hsl(270, 30%, 95%);
    --addon-text-muted: hsla(270, 15%, 75%, 0.7);
    --addon-accent-color: hsl(270, 35%, 60%);
    --addon-accent-hover-color: hsl(270, 40%, 70%);
}

.addon-wizard-container {
    position: fixed;
    inset: 0;
    z-index: 4500; /* Above overlay (4000) but below modal (5000) */
    background-color: rgba(10, 5, 20, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    padding: 1rem;
    font-family: 'Kanit', sans-serif;
    color: #fff;
}
.addon-wizard-container:not(.hidden) { opacity: 1; }
.addon-wizard-container.hidden { display: none; }

.addon-wizard-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.addon-wizard-header-controls {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 4605;
    display: flex;
    gap: 0.5rem;
}
.addon-wizard-header-btn {
    background: transparent;
    border: none;
    color: var(--addon-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.addon-wizard-header-btn:hover {
    color: var(--addon-text-header);
    background: rgba(255, 255, 255, 0.1);
}
.addon-wizard-header-btn .material-symbols-outlined {
    font-size: 24px;
}

.addon-wizard-content {
    width: 100%;
    max-width: 30rem;
    height: auto;
    max-height: 90vh;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
}

.addon-wizard-content.full-width {
    max-width: 100%;
    max-height: 100vh;
    height: 100%;
    padding: 2rem 0;
    box-sizing: border-box;
}
.addon-wizard-content.full-height {
    max-height: 90vh;
    height: auto;
}

.addon-wizard-step {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: addonWizardStepFadeIn 0.5s ease;
    flex-grow: 1;
    min-height: 0;
}

@keyframes addonWizardStepFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.addon-wizard-status-message {
    position: absolute;
    bottom: 2.5rem;
    left: 0;
    right: 0;
    font-size: 0.9rem;
    color: var(--addon-text-muted);
    text-align: center;
}

.addon-wizard-instruction {
    font-size: 1rem;
    color: var(--addon-text-muted);
    margin-top: 1.5rem;
}

.addon-wizard-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--addon-accent-color);
    color: #FFF;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}
.addon-wizard-button:hover {
    background: var(--addon-accent-hover-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
.addon-wizard-button:active { transform: translateY(0); }

.addon-lang-modal-container {
    position: absolute;
    inset: 0;
    background-color: rgba(10, 5, 20, 0.95);
    z-index: 9101;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: addonWizardStepFadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}
.addon-lang-modal-container.fade-out { opacity: 0; }

.addon-lang-modal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 300px;
}
.addon-lang-modal-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--addon-text-header);
    margin-bottom: 2rem;
}
.addon-lang-modal-content {
    text-align: center;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--addon-border-color) transparent;
    border-radius: 8px;
    scrollbar-gutter: stable;
}
.addon-lang-modal-content::-webkit-scrollbar { width: 6px; }
.addon-lang-modal-content::-webkit-scrollbar-track { background: transparent; margin: 0.75rem 0; }
.addon-lang-modal-content::-webkit-scrollbar-thumb { background-color: var(--addon-border-color); border-radius: 3px; }
.addon-lang-modal-content::-webkit-scrollbar-thumb:hover { background-color: var(--addon-accent-color); }

.addon-lang-modal-content ul { list-style: none; padding: 0; margin: 0; }
.addon-lang-modal-content li {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--addon-text-muted);
    padding: 0.75rem 0;
    margin: 0.75rem 0;
    cursor: pointer;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
    border-bottom: 2px solid transparent;
}
.addon-lang-modal-content li:hover {
    color: var(--addon-text-header);
    border-bottom-color: var(--addon-accent-color);
}

.addon-loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.addon-loading-logo {
    font-family: 'Monoton', cursive;
    font-size: 5rem;
    color: var(--addon-text-header);
    letter-spacing: 0.5rem;
    text-shadow: 0 0 20px rgba(var(--addon-canvas-rgb), 0.8);
    animation: addonLogoPulse 2s ease-in-out infinite;
}
.addon-loading-spinner {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(var(--addon-canvas-rgb), 0.1);
    border-top: 2px solid var(--addon-accent-color);
    border-radius: 50%;
    animation: addonSpin 1s linear infinite;
}
@keyframes addonLogoPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
@keyframes addonSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.addon-wizard-error-message {
    color: #ffcdd2;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.addon-wizard-result-view { justify-content: space-between; }
.addon-wizard-result-frame {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--addon-border-color);
    border-radius: 12px;
    width: 100%;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    padding: 1.5rem;
    box-sizing: border-box;
    display: flex;
    min-height: 0;
}
.addon-wizard-result-content {
    width: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: var(--addon-border-color) transparent;
}
.addon-wizard-result-content.has-scrollbar { padding-right: 1rem; }
.addon-wizard-result-content::-webkit-scrollbar { width: 6px; }
.addon-wizard-result-content::-webkit-scrollbar-track { background: transparent; }
.addon-wizard-result-content::-webkit-scrollbar-thumb { background-color: var(--addon-border-color); border-radius: 3px; }

.addon-wizard-result-footer {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.5s ease 0.5s;
}
.addon-wizard-result-footer.visible { opacity: 1; }
.addon-wizard-result-footer .addon-wizard-button {
    padding: 0.6rem;
    width: 40px;
    height: 40px;
    justify-content: center;
}

.addon-result-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--addon-border-color);
}
.addon-result-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.addon-wizard-result-title {
    color: var(--addon-text-muted);
    text-transform: uppercase;
    margin: 0;
}
.addon-wizard-result-text {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--addon-text-main);
    line-height: 1.7;
    white-space: pre-wrap;
}
.addon-wizard-result-text.typing::after {
    content: '|';
    animation: addonBlink 0.7s infinite;
}
@keyframes addonBlink { 50% { opacity: 0; } }

/* Cooldown Utility */
.addon-cooldown-active {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Damso Universe background control */
.addon-wizard-open #universe-form-container {
    display: none !important;
}
