/* Core Design Tokens & Theme Variables */
:root {
    --bg-dark: rgba(5, 4, 12, 0.98);
    --bg-header: linear-gradient(135deg, rgba(82, 45, 168, 0.95) 0%, rgba(20, 12, 38, 0.98) 100%);
    --bg-item-active: rgba(138, 43, 226, 0.15);
    
    /* Harmonious Color Palette */
    --color-primary: #8a2be2;      /* Purple Accent */
    --color-primary-glow: rgba(138, 43, 226, 0.6);
    --color-secondary: #00d2ff;    /* Cyan Accent */
    --color-secondary-glow: rgba(0, 210, 255, 0.6);
    --color-text: #ffffff;
    --color-text-dim: rgba(255, 255, 255, 0.65);
    --color-text-dark: rgba(255, 255, 255, 0.35);
    
    /* Notifications */
    --color-info: #8a2be2;
    --color-success: #00b34a;
    --color-error: #ff3333;
    
    /* Layout & Fonts */
    --font-futuristic: 'Syncopate', 'Orbitron', sans-serif;
    --font-clean: 'Inter', sans-serif;
    --border-radius: 12px;
    --border-glow: 1px solid rgba(138, 43, 226, 0.35);
    --box-shadow-glow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(138, 43, 226, 0.25);
    --transition-speed: 0.2s;
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-clean);
    background-color: transparent;
    color: var(--color-text);
}

/* Game Screenshot Background Simulator */
.game-background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(255, 94, 98, 0.8) 0%, rgba(128, 0, 128, 0.8) 40%, rgba(10, 5, 20, 1) 100%),
                linear-gradient(to bottom, #ff5e62, #800080, #0a0514);
    background-size: cover;
    opacity: 0.95;
    pointer-events: none;
}

.game-background-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35vh;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(20, 10, 30, 0.8) 60%, transparent 100%);
    clip-path: polygon(0% 100%, 0% 70%, 15% 55%, 30% 68%, 50% 45%, 70% 65%, 85% 50%, 100% 70%, 100% 100%);
}

#ui-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Menu Window */
.menu-window {
    position: absolute;
    width: 380px;
    height: 480px;
    background: var(--bg-dark);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--border-radius);
    border: var(--border-glow);
    box-shadow: var(--box-shadow-glow);
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    z-index: 10;
}



/* Glass Header / Banner */
.menu-header {
    height: 95px;
    background: radial-gradient(ellipse at center top, rgba(65, 25, 120, 0.7) 0%, #0b0414 100%);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: grab;
    border-top-left-radius: calc(var(--border-radius) - 1px);
    border-top-right-radius: calc(var(--border-radius) - 1px);
    overflow: hidden;
}

.menu-header:active {
    cursor: grabbing;
}

.menu-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at center, transparent 30%, rgba(255,255,255,0.015) 31%, transparent 32%),
        radial-gradient(circle at center, transparent 45%, rgba(255,255,255,0.015) 46%, transparent 47%),
        radial-gradient(circle at center, transparent 60%, rgba(255,255,255,0.015) 61%, transparent 62%);
    pointer-events: none;
    z-index: 1;
}

.menu-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(138, 43, 226, 0.8) 50%, transparent 100%);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
    z-index: 2;
}

.menu-logo {
    font-family: var(--font-futuristic);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
    z-index: 2;
    padding-top: 4px;
}

.menu-dots {
    position: absolute;
    top: 16px;
    right: 18px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 4px rgba(0,0,0,0.8);
}

.dot-1 { background-color: #a0a0a0; }
.dot-2 { background-color: #8a2be2; box-shadow: 0 0 6px rgba(138,43,226,0.6); }
.dot-3 { background-color: #a0a0a0; }

/* 3 MAIN Horizontal Tabs Under Header */
.menu-tabs {
    display: flex;
    height: 38px;
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
    z-index: 5;
}

.menu-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-clean);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--color-text-dim);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border-bottom: 2px solid transparent;
}

.menu-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.02);
}

.menu-tab.active {
    color: #5a1b9c;
    background: rgba(90, 27, 156, 0.05);
    border-bottom-color: #5a1b9c;
    text-shadow: 0 0 5px rgba(90, 27, 156, 0.4);
}

/* 1:1 Custom Scrollbar on Left Margin */
.custom-scrollbar-container {
    position: absolute;
    left: -20px;
    top: 130px; /* Directly below tabs */
    bottom: 62px; /* Directly above footer */
    width: 12px;
    z-index: 15;
    pointer-events: none;
}

.custom-scrollbar-track {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #07050d;
    border-radius: 6px;
    border: 1px solid rgba(82, 59, 140, 0.35);
}

.custom-scrollbar-thumb {
    position: absolute;
    width: 6px;
    height: 48px; /* Thumb Height */
    background-color: #5d2cd7;
    border-radius: 3px;
    left: 2px; /* Centers 6px thumb inside 10px track (excluding borders) */
    top: 0;
    transition: top 0.05s linear;
}

.custom-scrollbar-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 3px #ffffff, 0 0 6px rgba(93, 44, 215, 0.8);
}

/* Hide default browser scrollbars in CEF/DUI */
.menu-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0 10px 0; /* Adjusted for external scrollbar */
    scrollbar-width: none;
}

.menu-body::-webkit-scrollbar {
    display: none;
}

/* Views display and animation */
.menu-view {
    display: none;
    width: 100%;
}

.menu-view.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

/* Interactive Menu Items */
.menu-item {
    width: 100%;
    height: 48px;
    padding: 0 24px 0 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    position: relative;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* Active item representation (like currently active sub-menu list) */
.menu-item.active {
    background: rgba(138, 43, 226, 0.08);
    border-left: 3px solid var(--color-primary);
}

.menu-item.active .item-text {
    color: #a85cfd;
    font-weight: 600;
}

.menu-item.active .item-icon {
    color: #a85cfd;
}

/* KEYBOARD SELECTED ITEM (Glow and cyan border matching user request) */
.menu-item.keyboard-selected {
    background: transparent !important;
    border-left: none !important;
    box-shadow: none !important;
}

.menu-item.keyboard-selected .item-text {
    color: #5a1b9c !important;
    font-weight: 600;
}

.menu-item.keyboard-selected .item-icon {
    color: #5a1b9c !important;
    filter: drop-shadow(0 0 4px rgba(90, 27, 156, 0.5));
}

.menu-item.keyboard-selected .item-action {
    color: #5a1b9c !important;
}

/* Disabled item styles */
.menu-item.disabled {
    opacity: 0.45;
    cursor: default;
}

.menu-item.disabled:hover {
    background: transparent;
}

/* Item parts positioning */
.item-icon {
    width: 28px;
    font-size: 15px;
    color: var(--color-text-dim);
    display: flex;
    align-items: center;
    transition: color var(--transition-speed);
}

.menu-item:hover .item-icon {
    color: var(--color-text);
}

.item-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-dim);
    transition: color var(--transition-speed);
}

.menu-item:hover .item-text {
    color: var(--color-text);
}

.item-action {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
}

.item-action i {
    transition: transform var(--transition-speed);
}

.menu-item.keyboard-selected .item-action i {
    transform: rotate(90deg);
}

/* Back item styles */
.back-item {
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
    margin-bottom: 5px;
    background: rgba(138, 43, 226, 0.03);
}


/* Submenu subtitle label */
.submenu-title {
    padding: 10px 24px 6px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-primary);
}

/* Checkbox switches */
.toggle-switch {
    width: 34px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    position: relative;
    transition: background-color var(--transition-speed);
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.toggle-switch .switch-slider {
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.toggle-switch.checked {
    background-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

.toggle-switch.checked .switch-slider {
    transform: translateX(18px);
}

/* Slider Widget */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 45%;
}

.slider-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-dim);
    min-width: 20px;
    text-align: right;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    border-radius: 1.5px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 5px var(--color-primary-glow);
}

/* Selector with Variant widget (New `< Option >` UI layout) */
.selector-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 50%;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-dim);
}

.selector-arrow {
    padding: 2px 6px;
    cursor: pointer;
    color: var(--color-text-dark);
    transition: color var(--transition-speed);
}

.selector-arrow:hover {
    color: #ffffff;
}

.selector-variant-text {
    min-width: 70px;
    text-align: center;
    color: var(--color-text);
}

/* Colorpicker Preview Box */
.color-preview-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-preview-box {
    width: 22px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.2);
}

.color-preview-code {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-dim);
}

/* Footer layout */
.menu-footer {
    height: 50px;
    background: var(--bg-dark);
    border-top: 1px solid rgba(138, 43, 226, 0.15);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-left-radius: calc(var(--border-radius) - 1px);
    border-bottom-right-radius: calc(var(--border-radius) - 1px);
}

.footer-version {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-dark);
}

.footer-page-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-page-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-dim);
}

.footer-page-indicator {
    font-size: 11px;
    font-weight: 600;
    color: #f0f0f0;
    background: #442468;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Floating Color Picker Widget */
.colorpicker-window {
    position: absolute;
    width: 230px;
    background: var(--bg-dark);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--border-radius);
    border: var(--border-glow);
    box-shadow: var(--box-shadow-glow);
    display: none;
    flex-direction: column;
    padding: 12px;
    z-index: 20;
}

.colorpicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    cursor: grab;
}

.picker-close {
    font-size: 16px;
    cursor: pointer;
    color: var(--color-text-dim);
}

.picker-close:hover {
    color: var(--color-error);
}

.color-canvas-container {
    position: relative;
    width: 100%;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    cursor: crosshair;
}

#color-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.color-cursor {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 3px #000000;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hue-slider-container {
    margin-bottom: 10px;
}

.hue-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
    cursor: pointer;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 12px;
    border-radius: 3px;
    background: #ffffff;
    border: 1px solid #000000;
    cursor: pointer;
}

.color-inputs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hex-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.alpha-slider-container {
    flex: 1;
}

.alpha-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    outline: none;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    cursor: pointer;
}

.alpha-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
}

/* NOTIFICATIONS */
#notifications-container {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    pointer-events: none;
}

.notification {
    pointer-events: auto;
    width: 290px;
    background: rgba(12, 10, 24, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    animation: slideInNotification 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes slideInNotification {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.fade-out {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.notification-body {
    flex: 1;
}

.notification-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.notification-desc {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    line-height: 14px;
}

.notification-info .notification-icon {
    background-color: rgba(138, 43, 226, 0.15);
    color: #a85cfd;
    border: 1px solid rgba(138, 43, 226, 0.3);
}
.notification-info .notification-accent {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 3px;
    height: calc(100% - 28px);
    background-color: #a85cfd;
    border-radius: 1.5px;
    box-shadow: 0 0 8px #a85cfd;
}

.notification-success .notification-icon {
    background-color: rgba(0, 179, 74, 0.15);
    color: #00e05d;
    border: 1px solid rgba(0, 179, 74, 0.3);
}
.notification-success .notification-accent {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 3px;
    height: calc(100% - 28px);
    background-color: #00b34a;
    border-radius: 1.5px;
    box-shadow: 0 0 8px #00b34a;
}

.notification-error .notification-icon {
    background-color: rgba(255, 51, 51, 0.15);
    color: #ff5c5c;
    border: 1px solid rgba(255, 51, 51, 0.3);
}
.notification-error .notification-accent {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 3px;
    height: calc(100% - 28px);
    background-color: #ff3333;
    border-radius: 1.5px;
    box-shadow: 0 0 8px #ff3333;
}

/* SIMULATOR CARD */
.demo-card {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 280px;
    background: rgba(10, 8, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 99;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.demo-card.minimized {
    transform: translateX(-240px);
}

.demo-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#demo-arrow {
    transition: transform 0.3s ease;
}

.demo-card.minimized #demo-arrow {
    transform: rotate(180deg);
}

.demo-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 80vh;
    overflow-y: auto;
}

.demo-info {
    font-size: 11px;
    color: var(--color-text-dim);
    line-height: 15px;
}

.demo-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-section h4 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-secondary);
    margin-bottom: 4px;
}

.btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-clean);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    transition: background 0.2s, box-shadow 0.2s;
    text-align: center;
}

.btn-purple {
    background: var(--color-primary);
}
.btn-purple:hover {
    background: #9d3eff;
}

.btn-success {
    background: var(--color-success);
}
.btn-success:hover {
    background: #00cc55;
}

.btn-danger {
    background: var(--color-error);
}
.btn-danger:hover {
    background: #ff5555;
}

.instruction-text {
    font-size: 10px;
    color: var(--color-text-dim);
    line-height: 14px;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.03);
}
