@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #181028;
    --bg-secondary: #22143a;
    --bg-tertiary: #2a1847;
    --text-primary: #f4f0ff;
    --text-secondary: #b8a4e3;
    --border-color: #2d1a4d;
    --accent-primary: #a259f7;
    --accent-secondary: #c084fc;
    --accent-gradient: linear-gradient(90deg, #a259f7 0%, #7c3aed 100%);
    --accent-primary-hover: #7c3aed;
    --success-color: #10b981;
    --error-color: #ef4444;
    --disabled-color: #3a2a4d;
    --card-shadow: 0 4px 24px 0 rgba(80, 0, 120, 0.25);
    --border-radius: 16px;
    --footer-bg: #000000;
}

/* Tiny footer (used on TOS page) */
.tiny-footer { position: fixed; left: 0; right: 0; bottom: 0; background: #000000; border-top: 1px solid #222; z-index: 100; font-size: 0.8rem; padding: 0.2rem 0; }

/* --- General --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px; /* for footer */
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 2.5rem auto 1.5rem auto;
    padding: 1.5rem;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
}
h1 { font-size: 2.5rem; text-align: center; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; margin-bottom: 2rem; }
h3 { font-size: 1.15rem; }

p {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* --- Header & Navigation --- */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px 0 rgba(80,0,120,0.08);
}

header .logo {
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--accent-secondary);
    letter-spacing: 0.04em;
    text-shadow: 0 2px 8px #7c3aed33;
}

nav { display: flex; align-items: center; gap: 1.2rem; }

nav a {
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.6rem 1.3rem;
    border-radius: var(--border-radius);
    transition: color 0.2s, background 0.2s;
    font-size: 1.05rem;
}
nav a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
nav a.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: 0 2px 8px #a259f733;
}
nav a.active:hover {
    background: var(--accent-primary-hover);
}

/* --- Buttons --- */
.button, button {
    display: inline-block;
    background: var(--accent-gradient);
    color: #fff;
    padding: 13px 28px;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 12px #a259f733;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    letter-spacing: 0.01em;
}
.button:hover:not([disabled]), button:hover:not([disabled]) {
    background: linear-gradient(90deg, #7c3aed 0%, #a259f7 100%);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px #a259f755;
}
.button.secondary, button.secondary {
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
    border: 1px solid var(--accent-secondary);
}
.button.secondary:hover:not([disabled]), button.secondary:hover:not([disabled]) {
    background: var(--accent-primary-hover);
    color: #fff;
}
button[disabled] {
    background: var(--disabled-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}
.button.small {
    padding: 6px 12px;
    font-size: 1.1em;
    min-width: 36px;
    min-height: 36px;
    line-height: 1;
}
.button.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}
.button.loading::after {
    content: '';
    border: 2px solid #fff;
    border-top: 2px solid #a259f7;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.7s linear infinite;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}
@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg);}
    100% { transform: translateY(-50%) rotate(360deg);}
}

/* --- Forms & Inputs --- */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
}
label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-secondary);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 13px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0.2rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px #a259f755;
}

/* --- Cards & Containers --- */
.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2.2rem 2rem 2rem 2rem;
    margin-bottom: 2.5rem;
    transition: box-shadow 0.2s;
    border: 1.5px solid var(--border-color);
}
.card-centered {
    max-width: 520px;
    margin: 2.5rem auto;
    padding: 2.5rem 2rem;
}
.card:hover {
    box-shadow: 0 8px 32px #a259f744;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
th, td {
    padding: 1rem 1.2rem;
    text-align: left;
    color: var(--text-primary);
}
th {
    background: var(--bg-secondary);
    color: var(--accent-secondary);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}
tr {
    border-bottom: 1px solid var(--border-color);
}
tr:last-child td {
    border-bottom: none;
}
tr:hover {
    background: #2a1847cc;
}

/* --- Footer --- */
.site-footer {
    background: #000000;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.92rem;
    text-align: center;
    padding: 0.25rem 0 0.15rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
    margin: 0;
    min-height: unset;
    height: 32px;
    line-height: 1.2;
}
.site-footer p {
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}
.site-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}
.site-footer a:hover {
    color: rgba(255, 255, 255, 1);
}

/* --- Miscellaneous --- */
/* Inline style migration utilities */
.hidden { display: none !important; }
.block { display: block !important; }
.flex { display: flex !important; }
.inline-block { display: inline-block !important; }
.relative { position: relative !important; }
.opacity-0 { opacity: 0 !important; }
.message-container {
    margin-top: 1rem;
    min-height: 1.5em;
}

/* Profile: Google account section */
#google-account-box { padding: 1rem; }
#google-account-status { margin-bottom: 0.75rem; }
#google-account-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
#google-account-message { margin-top: 0.75rem; }

/* Spaced horizontal rule */
.hr-spaced { margin: 2rem 0; }

/* Navbar: hamburger + mobile open state */
#hamburger-menu { display: none; flex-direction: column; justify-content: center; align-items: center; width: 40px; height: 40px; cursor: pointer; margin-left: auto; }
#hamburger-menu span { display: block; height: 4px; width: 28px; background: #fff; margin: 4px 0; border-radius: 2px; }
nav .nav-links.mobile-open { display: flex; flex-direction: column; background: #18122B; position: absolute; top: 60px; left: 0; width: 100vw; z-index: 2000; box-shadow: 0 2px 8px #00000033; }

/* Profile: Google linked row */
.google-user-row { display: flex; align-items: center; gap: 10px; }
.google-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* Unlink modal */
.unlink-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.unlink-modal { background: #fff; padding: 20px; border-radius: 8px; width: 100%; max-width: 420px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.unlink-modal h3 { font-weight: 600; margin-bottom: 10px; }
.unlink-modal p { margin: 0 0 12px; color: #555; }
.unlink-modal label { margin-bottom: 6px; display: block; }
.unlink-modal input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
.unlink-modal .error { color: #c62828; margin-top: 8px; }
.unlink-modal .btn-row { display: flex; gap: 10px; margin-top: 12px; }
.unlink-modal .btn-row .button { flex: 1; }

/* Generic utilities */
.mt-4 { margin-top: 1rem !important; }
.items-start { align-items: flex-start !important; }
.cursor-pointer { cursor: pointer !important; }
.w-full { width: 100% !important; }

/* Toasts (centered messages) */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #222; padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 1000; text-align: center; max-width: 400px; }
.toast-success { background: #e8f5e8; color: #2e7d32; }
.toast-error { background: #ffebee; color: #d32f2f; }
.toast-spinner { width: 20px; height: 20px; border: 2px solid #f3f3f3; border-top: 2px solid #4285f4; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.mb-3 { margin-bottom: 15px !important; }
/* Generic button row */
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .button { flex: 1; }
.text-center { text-align: center !important; }
.gap-2 { gap: 10px !important; }
.text-sm { font-size: 0.875rem !important; }
.text-muted { color: #666 !important; }
.font-bold { font-weight: 600 !important; }
.mt-5 { margin-top: 20px !important; }

/* Button color modifiers */
.button.btn-primary { background: #4285f4; color: #fff; border: none; }
.button.btn-success { background: #34a853; color: #fff; border: none; }
.button.btn-secondary { background: #e0e0e0; color: #333; border: none; }

/* TOS label utility for signup */
.tos-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 400; }
.tos-label input[type="checkbox"] { margin-top: 2px; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mt-12 { margin-top: 3rem !important; }
.mt--4 { margin-top: -1rem !important; }
.mb-8 { margin-bottom: 2rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.gap-4 { gap: 1rem !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-center { justify-content: center !important; }
.text-secondary { color: var(--text-secondary) !important; }
.max-w-600 { max-width: 600px !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.pt-8 { padding-top: 2rem !important; }
.border-t { border-top: 1px solid #eee !important; }

/* Section divider block */
.section-divider { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #eee; }

/* Processing modal */
.processing-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(24, 16, 40, 0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.processing-inner { background: var(--bg-secondary); padding: 2.5em 2em; border-radius: 18px; box-shadow: 0 8px 40px #00000066; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.processing-message { color: var(--accent-secondary); font-size: 1.2em; text-align: center; min-width: 260px; }
.processing-spinner { border: 4px solid #a259f7; border-top: 4px solid #fff; border-radius: 50%; width: 38px; height: 38px; animation: spin 0.8s linear infinite; }
body.modal-open { overflow: hidden; }

/* Input error state */
input.input-error, textarea.input-error, select.input-error { border-color: #d32f2f !important; }

/* Google login button (moved from inline <style> in register.html) */
.google-login-btn { width: 100%; padding: 12px; background: #fff; color: #333; border: 2px solid #e1e5e9; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.google-login-btn:hover { background: #f8f9fa; border-color: #4285f4; }
.google-login-btn:active { background: #f1f3f4; transform: translateY(0.5px); }
.google-login-btn:focus-visible { outline: 2px solid #4285f4; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(66,133,244,0.25); }
.google-icon { width: 18px; height: 18px; }

/* Divider component */
.divider { text-align: center; margin: 20px 0; position: relative; }
.divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #e1e5e9; }
.divider span { background: #fff; padding: 0 15px; color: #666; font-size: 14px; }

/* Layout utilities */
.flex-1 { flex: 1 1 auto !important; }
.basis-150px { flex-basis: 150px !important; }
.basis-200px { flex-basis: 200px !important; }
.min-w-120px { min-width: 120px !important; }
.min-w-150px { min-width: 150px !important; }

/* Typography utilities */
.text-lg { font-size: 1.1em !important; }
.text-xs { font-size: 0.8rem !important; }

/* Spacing utilities */
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.error-message {
    color: var(--error-color);
    font-weight: 600;
}
.success-message {
    color: var(--success-color);
    font-weight: 600;
}

::-webkit-scrollbar {
    width: 10px;
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 8px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .container { padding: 0.5rem; }
    .card, .card-centered { padding: 1.2rem; }
    header { padding: 1rem 1.2rem; }
}
@media (max-width: 600px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.1rem; }
    .container { width: 99%; }
    .card-centered { max-width: 99vw; }
    nav { gap: 0.5rem; }
    nav a { padding: 0.4rem 0.7rem; font-size: 0.98rem; }
    body {
        font-size: 1.1em;
        padding: 0;
        margin: 0;
        background: #18122B;
    }
    .container, .profile-container, .dashboard-container {
        width: 100vw;
        min-width: 0;
        padding: 0.5em 0.5em 4em 0.5em;
        box-sizing: border-box;
    }
    .profile-tabs {
        flex-direction: column;
        width: 100%;
    }
    .tab {
        width: 100%;
        margin-bottom: 0.5em;
        font-size: 1.1em;
    }
    .tab-content {
        padding: 1em 0.5em;
    }
    form, .form-section {
        width: 100%;
        min-width: 0;
        padding: 0.5em;
        box-sizing: border-box;
    }
    input, button, select {
        font-size: 1.1em;
        width: 100%;
        margin-bottom: 1em;
        padding: 0.8em 0.5em;
        border-radius: 8px;
    }
    .footer {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100vw;
        background: #18122B;
        color: #fff;
        text-align: center;
        padding: 1em 0;
        font-size: 1em;
        z-index: 1000;
        box-shadow: 0 -2px 8px #00000033;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .footer span, .footer p {
        color: #fff;
        font-size: 1em;
        margin: 0 auto;
        display: block;
    }
    nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.5em 1em;
    }
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5em;
    }
    .nav-links a {
        width: 100%;
        padding: 0.8em 0;
        text-align: left;
        font-size: 1.1em;
    }
}

/* --- Admin & Page-specific --- */

.table-container {
    overflow-x: auto;
}

.status-active {
    color: var(--success-color);
    font-weight: 500;
}

.status-suspended {
    color: var(--error-color);
    font-weight: 500;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.product-card-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.product-card-actions {
    padding: 0 1.5rem 1.5rem;
}

#user-info,
#user-stats {
    margin-bottom: 2rem;
}
#new-license-key {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
    word-break: break-all;
}

.cart-table {
    margin-bottom: 2rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1rem 0;
    margin-top: 1rem;
}

.button-full-width {
    width: 100%;
    margin-top: 1rem;
}

.download-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.3);
}

.download-info h3 {
    margin-bottom: 0.5rem;
}

.download-info p {
    color: var(--text-secondary);
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.download-action {
    margin-top: auto;
}

.cart-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cart-header,
.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 80px;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.cart-header {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: transparent;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.cart-item-product {
    display: flex;
    flex-direction: column;
}

.cart-item-product small {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cart-table {
    margin-bottom: 2rem;
}

/* Update Banner Styles */
.update-banner {
    background-color: #f0f7ff;
    color: var(--bg-primary);
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: left;
    position: relative;
}

.update-banner h2 {
    margin-top: 0;
    color: #0056b3;
    text-align: center;
}

.update-banner ul {
    list-style-type: '✓';
    padding-left: 2rem;
}

.update-banner ul li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #0056b3;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        margin-top: 1rem;
        flex-direction: column;
    }

    nav a {
        width: 100%;
        text-align: center;
    }
}

.iti {
    width: 100%;
}
.iti input[type="tel"] {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.iti input[type="tel"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px #8B5CF640;
}
.iti__country-list {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}
.iti__country-list .iti__country {
    color: var(--text-primary);
}
.iti__country-list .iti__country.iti__highlight {
    background: var(--accent-primary);
    color: #fff;
}
.iti__flag-container {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}
.iti__selected-flag {
    background: var(--bg-secondary);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}
.iti__arrow {
    border-top: 4px solid var(--accent-primary);
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.big-centered {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem 0;
    letter-spacing: 0.01em;
}

/* --- CSP Utilities for Animations (no inline styles) --- */
/* Opacity utilities */
.opacity-100 { opacity: 1 !important; }
.opacity-0 { opacity: 0 !important; }

/* Transition helpers */
.transition-all { transition: all 1s cubic-bezier(0.4, 0, 0.2, 1) !important; }
.enter-transition { transition: all 1s cubic-bezier(0.4, 0, 0.2, 1) !important; }
.transition-opacity { transition: opacity 0.8s cubic-bezier(.68,-0.55,.27,1.55) !important; }

/* Entrance state helpers */
.enter-start { opacity: 0 !important; transform: translateY(30px) scale(0.9) !important; }
.enter-end { opacity: 1 !important; transform: translateY(0) scale(1) !important; }

/* Background pulse helpers */
@keyframes bgPulseScale { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes bgPulseFade { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
.bg-pulse-scale { animation: bgPulseScale 5s ease-in-out infinite; }
.bg-pulse-fade { animation: bgPulseFade 5s ease-in-out infinite; }

/* Background emphasis states */
.bg-scale-120 { transform: scale(1.2) !important; }
.opacity-40 { opacity: 0.4 !important; }
.opacity-80 { opacity: 0.8 !important; }
.opacity-90 { opacity: 0.9 !important; }
.bg-scale-105 { transform: scale(1.05) !important; }
.spin-720 { transform: rotateY(720deg) !important; }

/* Particle randomization helpers */
/* Left position in 5% increments */
.left-0 { left: 0% !important; }
.left-5 { left: 5% !important; }
.left-10 { left: 10% !important; }
.left-15 { left: 15% !important; }
.left-20 { left: 20% !important; }
.left-25 { left: 25% !important; }
.left-30 { left: 30% !important; }
.left-35 { left: 35% !important; }
.left-40 { left: 40% !important; }
.left-45 { left: 45% !important; }
.left-50 { left: 50% !important; }
.left-55 { left: 55% !important; }
.left-60 { left: 60% !important; }
.left-65 { left: 65% !important; }
.left-70 { left: 70% !important; }
.left-75 { left: 75% !important; }
.left-80 { left: 80% !important; }
.left-85 { left: 85% !important; }
.left-90 { left: 90% !important; }
.left-95 { left: 95% !important; }
.left-100 { left: 100% !important; }

/* Animation duration in whole seconds (12s..20s) */
.anim-dur-12 { animation-duration: 12s !important; }
.anim-dur-13 { animation-duration: 13s !important; }
.anim-dur-14 { animation-duration: 14s !important; }
.anim-dur-15 { animation-duration: 15s !important; }
.anim-dur-16 { animation-duration: 16s !important; }
.anim-dur-17 { animation-duration: 17s !important; }
.anim-dur-18 { animation-duration: 18s !important; }
.anim-dur-19 { animation-duration: 19s !important; }
.anim-dur-20 { animation-duration: 20s !important; }

/* Animation delay in whole seconds (0s..5s) */
.anim-delay-0 { animation-delay: 0s !important; }
.anim-delay-1 { animation-delay: 1s !important; }
.anim-delay-2 { animation-delay: 2s !important; }
.anim-delay-3 { animation-delay: 3s !important; }
.anim-delay-4 { animation-delay: 4s !important; }
.anim-delay-5 { animation-delay: 5s !important; }

/* Footer base style for all screens */
.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    background: #18122B;
    color: #fff;
    text-align: center;
    padding: 1em 0;
    font-size: 1.1em;
    z-index: 1000;
    box-shadow: 0 -2px 8px #00000033;
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer span, .footer p {
    color: #fff;
    font-size: 1.1em;
    margin: 0 auto;
    display: block;
} 

/* --- Chat UI Improvements --- */
.chat-container {
    max-width: 600px;
    margin: 2rem auto;
    background: var(--bg-secondary, #fff);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(80,0,120,0.10);
    display: flex;
    flex-direction: column;
    height: 70vh;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1rem 1rem 1rem;
    border-bottom: 1px solid #eee;
    background: var(--bg-primary, #f8f7fa);
}
.chat-message {
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.01);
    border-radius: 8px;
    padding: 0.5em 0.8em;
    box-shadow: 0 1px 4px #a259f71a;
    transition: background 0.2s, box-shadow 0.2s, opacity 0.3s;
}
.chat-message:focus {
    outline: 2px solid var(--accent-primary);
}
.chat-system-alert {
    background: var(--error-color, #c00);
    color: #fff;
    padding: 0.7em 1.2em;
    border-radius: 6px;
    margin: 0.7em 0;
    font-weight: 600;
    box-shadow: 0 2px 8px #a259f733;
    text-align: center;
    font-size: 1.05em;
}
.chat-message .meta {
    font-size: 0.85em;
    color: #7c3aed;
    margin-bottom: 0.2em;
    font-weight: 600;
}
.chat-message .admin-badge {
    color: #fff;
    background: #a259f7;
    border-radius: 4px;
    padding: 0 0.4em;
    font-size: 0.8em;
    margin-left: 0.3em;
}
.chat-message .text {
    white-space: pre-line;
    font-size: 1em;
    color: #18122B;
}
.chat-input-row {
    display: flex;
    padding: 1rem;
    gap: 0.5rem;
    background: var(--bg-secondary, #fff);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
.chat-input-row textarea {
    flex: 1;
    padding: 0.7rem;
    border-radius: 6px;
    border: 1px solid #a259f7;
    font-size: 1.08em;
    min-height: 38px;
    max-height: 120px;
    resize: none;
    background: #f8f7fa;
    transition: border 0.2s;
}
.chat-input-row textarea:focus {
    border: 2px solid #7c3aed;
    outline: none;
}
.chat-input-row button {
    padding: 0.7rem 1.5rem;
    font-size: 1.08em;
}
.chat-error {
    color: var(--error-color, #c00);
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.chat-loading {
    text-align: center;
    color: #888;
    font-size: 1.1em;
    margin: 1em 0;
} 

.chat-typing-indicator {
    color: var(--accent-secondary);
    font-size: 0.98em;
    margin: 0.5em 0 0.5em 0.5em;
    font-style: italic;
    display: block;
} 

@media (max-width: 600px) {
    .chat-message { font-size: 0.98em; padding: 0.4em 0.5em; }
    .chat-system-alert { font-size: 0.98em; padding: 0.5em 0.7em; }
} 