:root {
    --bg-dark: #0a0a0f;
    --primary-glow: rgba(212, 163, 42, 0.6);
    --secondary-glow: rgba(45, 212, 191, 0.4);
    
    --glass-bg: rgba(20, 20, 25, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --accent: #d4a32a;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: clip;
    position: relative;
}

/* Atmospheric animated background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--primary-glow) 0%, transparent 20%),
                radial-gradient(circle at 80% 20%, var(--secondary-glow) 0%, transparent 20%);
    opacity: 0.15;
    animation: pulse 15s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.2) rotate(5deg); }
}

/* Premium Glass Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.brand-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, #d4a32a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

/* Inputs */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.glass-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.glass-input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(212, 163, 42, 0.15);
}

/* Button */
.btn-glow {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(212, 163, 42, 0.4);
    background: #e5b336;
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff6b81;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    text-align: center;
}

/* Navbar & Brand Styles */
@keyframes navbarChromaRun {
    0% { filter: hue-rotate(0deg); background-position: 0% 50%; }
    50% { filter: hue-rotate(180deg); background-position: 100% 50%; }
    100% { filter: hue-rotate(360deg); background-position: 0% 50%; }
}
.chroma-brand-text {
    display: inline-block !important;
    background: linear-gradient(90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #30b0c7, #32ade6, #007aff, #5856d6, #af52de, #ff2d55, #ff3b30) !important;
    background-size: 300% 300% !important;
    color: transparent !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    will-change: filter, background-position !important;
    animation: navbarChromaRun 4s linear infinite !important;
}

/* Fixed Floating Bottom Creation Bar */
.bottom-creation-wrapper {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1040;
}

.bottom-creation-wrapper.is-chat-page-hidden {
    display: none !important;
}

.bottom-creation-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(12, 16, 26, 0.92);
    border: 1.5px solid rgba(212, 163, 42, 0.45);
    padding: 10px 22px;
    border-radius: 30px;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 163, 42, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-creation-btn:hover, .bottom-creation-btn.active {
    background: rgba(212, 163, 42, 0.2);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.7), 0 0 28px rgba(212, 163, 42, 0.45);
    transform: scale(1.05);
}

.bottom-creation-icon {
    font-size: 1.15rem;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.bottom-creation-btn:hover .bottom-creation-icon {
    transform: rotate(15deg) scale(1.15);
}

.bottom-creation-chevron {
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.25s ease;
}

.bottom-creation-btn.active .bottom-creation-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.bottom-creation-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(12px) scale(0.94);
    width: 260px;
    background: rgba(12, 16, 26, 0.96);
    border: 1.5px solid rgba(212, 163, 42, 0.35);
    border-radius: 18px;
    padding: 12px 0;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 163, 42, 0.2);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}

.bottom-creation-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.bottom-creation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 12px 18px;
}

.bottom-creation-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #f59e0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(212, 163, 42, 0.4);
}

.bottom-creation-details {
    display: flex;
    flex-direction: column;
}

.bottom-creation-title {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
}

.bottom-creation-subtitle {
    color: #94a3b8;
    font-size: 0.75rem;
}

.bottom-creation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bottom-creation-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding-left: 22px;
}

.bottom-creation-item .item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bottom-creation-item .item-text {
    display: flex;
    flex-direction: column;
}

.bottom-creation-item .item-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.bottom-creation-item .item-desc {
    font-size: 0.73rem;
    color: #94a3b8;
}

/* User Account Dropdown Styling */
.user-dropdown-wrapper {
    position: relative;
    display: inline-block;
}
.user-pill-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 25px;
    color: #f1f5f9;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}
.user-pill-btn:hover, .user-pill-btn.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(212, 163, 42, 0.25);
}
.user-avatar-icon {
    font-size: 1.1rem;
    color: var(--accent);
}
.user-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}
.user-pill-btn.active .user-chevron {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}
.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
}
.dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #f3c64d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.dropdown-user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dropdown-username {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-role-badge {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: capitalize;
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 6px 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.dropdown-link i {
    width: 16px;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.dropdown-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.dropdown-link:hover i {
    color: var(--accent);
}

/* Submenu Group inside User Dropdown */
.dropdown-submenu-item {
    position: relative;
    width: 100%;
}
.dropdown-submenu-content {
    display: none;
    flex-direction: column;
    background: rgba(10, 15, 30, 0.6);
    border-left: 2px solid var(--accent, #d4a32a);
    margin: 2px 12px 6px 18px;
    border-radius: 0 8px 8px 0;
}
.dropdown-submenu-item:hover .dropdown-submenu-content,
.dropdown-submenu-item.open .dropdown-submenu-content {
    display: flex;
}
.dropdown-submenu-item:hover .submenu-chevron,
.dropdown-submenu-item.open .submenu-chevron {
    transform: rotate(90deg);
    color: var(--accent) !important;
}
.dropdown-link.sub-link {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.dropdown-link.admin-link:hover i {
    color: #38bdf8;
}

.dropdown-link.logout-link {
    color: #ff6b81;
}
.dropdown-link.logout-link i {
    color: #ff6b81;
}
.dropdown-link.logout-link:hover {
    background: rgba(255, 107, 129, 0.12);
    color: #ff4757;
}

/* ── Floating Toast Notifications ── */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
    width: 100%;
}

.ggz-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(15, 20, 30, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ggz-toast.ggz-toast-enter {
    opacity: 1;
    transform: translateX(0);
}

.ggz-toast.ggz-toast-exit {
    opacity: 0;
    transform: translateX(40px);
}

.ggz-toast-success { border-left: 3px solid #2ed573; }
.ggz-toast-error   { border-left: 3px solid #ff4757; }

.ggz-toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.ggz-toast-success .ggz-toast-icon { color: #2ed573; }
.ggz-toast-error   .ggz-toast-icon { color: #ff4757; }

.ggz-toast-body {
    flex: 1;
    min-width: 0;
}

.ggz-toast-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 2px;
}
.ggz-toast-success .ggz-toast-title { color: #2ed573; }
.ggz-toast-error   .ggz-toast-title { color: #ff4757; }

.ggz-toast-message {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.ggz-toast-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: color 0.2s ease;
}
.ggz-toast-close:hover { color: #f8fafc; }

.ggz-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
}

.ggz-toast-progress-bar {
    height: 100%;
    border-radius: 0 0 0 12px;
    animation: toastProgressShrink 4s linear forwards;
}
.ggz-toast-success .ggz-toast-progress-bar { background: #2ed573; }
.ggz-toast-error   .ggz-toast-progress-bar { background: #ff4757; }

@keyframes toastProgressShrink {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Mobile: toasts at top center */
@media (max-width: 640px) {
    #toastContainer {
        bottom: auto;
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .ggz-toast {
        transform: translateY(-30px);
    }
    .ggz-toast.ggz-toast-enter {
        transform: translateY(0);
    }
    .ggz-toast.ggz-toast-exit {
        transform: translateY(-30px);
    }
}
