/* ------------------------------------------------------------------- */
/* 1. Root Variables & Global Reset */
/* ------------------------------------------------------------------- */

:root {
    /* Colors */
    --bg-dark: #090c10;          
    --bg-medium-glass: rgba(23, 29, 36, 0.7);
    --neon-blue: #00e0ff;        /* Primary ACCENT color (links/buttons/active) */
    --neon-red: #ff0055;         /* Secondary ACCENT color (errors/alerts/delete) */
    
    /* PRIORITY SWAP: Defining the Visuals */
    --btn-visual-primary: var(--neon-blue);   /* Blue is the main visual color */
    --btn-visual-secondary: var(--neon-red);  /* Red is the secondary visual color */
    
    --text-light: #e0e7ff;       
    --text-muted: #94a3b8;       

    /* Typography, Spacing, & Effects (Unchanged) */
    --font-family: 'Inter', sans-serif;
    --h1-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    --border-radius: 8px;
    --transition-fast: 0.2s ease-in-out;
    --transition-medium: 0.4s ease-in-out;
    --shadow-intensity: 0.5;
    --glass-blur: blur(15px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-light);
    text-shadow: 0 0 5px var(--neon-blue);
}
/* ... (Section 2 - Layout Structure - Unchanged) ... */

/* ------------------------------------------------------------------- */
/* 2. Layout Structure (Header, Sidebar, Wrapper) */
/* ------------------------------------------------------------------- */

/* Header (Made slightly transparent with blur) */
.header {
    background-color: var(--bg-medium-glass);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--neon-blue);
    text-shadow: var(--h1-shadow);
    transition: var(--transition-medium);
}

/* Wrapper for Sidebar + Main Content */
.wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar (Navigation) - Now Glassmorphism */
.sidebar {
    width: 250px;
    background-color: var(--bg-medium-glass); /* Glass BG */
    backdrop-filter: var(--glass-blur); /* Liquid Glass Effect */
    padding: 20px 0;
    flex-shrink: 0;
    transition: transform 0.3s ease, width 0.3s ease;
    border-right: 1px solid rgba(0, 240, 255, 0.1);
    position: sticky;
    top: 66px;
    height: calc(100vh - 66px);
    overflow-y: auto;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition-fast);
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    color: var(--neon-blue);
    background-color: rgba(0, 240, 255, 0.05);
    border-left-color: var(--neon-blue);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

/* Main Content Area */
.main-content-wrapper {
    flex-grow: 1;
    padding: 30px;
    animation: fadeIn 0.8s ease-out;
}

.main-content h1 {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 2rem;
    text-shadow: var(--h1-shadow);
}

/* ------------------------------------------------------------------- */
/* 3. Dashboard Components (Cards & Tables) - Now Glassmorphism */
/* ------------------------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--bg-medium-glass); /* Glass BG */
    backdrop-filter: var(--glass-blur); /* Liquid Glass Effect */
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.05), inset 0 0 8px rgba(0, 240, 255, 0.02);
    transition: var(--transition-medium);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 240, 255, 0.15), inset 0 0 15px rgba(0, 240, 255, 0.08);
}

.card h3 {
    color: var(--neon-red);
    font-size: 1.25rem;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(255, 0, 85, 0.4);
}

/* Data Table (Live Stats) - Now Glassmorphism */
.system-table-wrapper {
    background-color: var(--bg-medium-glass); /* Glass BG */
    backdrop-filter: var(--glass-blur); /* Liquid Glass Effect */
    border-radius: var(--border-radius);
    overflow-x: auto;
    border: 1px solid rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    /* RETAINED: Min-width allows shrinking but forces scroll if needed */
    min-width: 400px; 
}

.data-table th, .data-table td {
    /* RETAINED: Padding adjusted for less vertical space on all screens */
    padding: 8px 20px;
    text-align: left;
    /* Reduced opacity on internal lines */
    border-bottom: 1px solid rgba(255, 255, 255, 0.03); 
}

.data-table th {
    background-color: rgba(0, 240, 255, 0.05);
    color: var(--neon-blue);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.data-table tr:hover {
    background-color: rgba(255, 0, 85, 0.03);
}

.data-table td.value {
    font-weight: 500;
    color: var(--text-light);
}

/* RETAINED: Forces long metric names to wrap and sets column widths (crucial for dashboard) */
.data-table tbody td:first-child {
    white-space: normal; /* Allow text to wrap to the next line */
    width: 60%; /* Give the Metric column a defined, larger portion of the width */
}

.data-table tbody td.value {
    width: 40%; /* Give the Value column a smaller, defined portion of the width */
    white-space: nowrap; /* Keep the value (number) on one line */
}


/* ------------------------------------------------------------------- */
/* 4. Slot Machine Specific Styles (Now Glassmorphism Container) */
/* ------------------------------------------------------------------- */

.slot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-medium-glass); /* Glass BG */
    backdrop-filter: var(--glass-blur); /* Liquid Glass Effect */
    border: 2px solid var(--neon-blue); 
    border-radius: 18px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), inset 0 0 15px rgba(0, 255, 255, 0.05);
    padding: 3px;
    max-width: 100%;
    color: var(--text-light);
}
/* Note: Slot Reel items must have a dark background to show text contrast */
.slot-window {
    width: 250px;
    height: calc(3 * var(--item-height));
    overflow: hidden;
    position: relative;
    border: 2px solid var(--neon-red);
    border-radius: 12px;
    background: linear-gradient(145deg, #0f1a2b, #050a10);
    box-shadow:
        inset 0 5px 15px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 0, 85, 0.4);
    transition: all 0.3s ease-in-out;
}
.slot-reel {
    display: flex;
    flex-direction: column;
    will-change: transform;
    transition: transform var(--spin-duration) var(--spin-easing);
}
.outcome-item {
    height: var(--item-height);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--neon-blue);
    background-color: var(--bg-dark); /* Keeps reel items opaque for visibility */
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}
.outcome-item:last-child { border-bottom: none; }
.top-blur-overlay, .bottom-blur-overlay {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10;
    opacity: 0.8;
}
.top-blur-overlay {
    top: 0;
    height: var(--item-height);
    background: linear-gradient(to bottom, var(--bg-dark), rgba(10, 10, 10, 0));
}
.bottom-blur-overlay {
    bottom: 0;
    height: var(--item-height);
    background: linear-gradient(to top, var(--bg-dark), rgba(10, 10, 10, 0));
}
#spinButton {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 14px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-medium);
    background-color: var(--neon-blue);
    color: var(--bg-dark);
    box-shadow: 0 5px 20px rgba(0, 240, 255, var(--shadow-intensity)), 0 0 25px var(--neon-blue) inset;
}
#spinButton:hover {
    background-color: var(--text-light);
    box-shadow: 0 10px 40px var(--neon-blue), 0 0 40px var(--neon-blue) inset;
    transform: translateY(-2px);
}
#spinButton:active {
    transform: translateY(0);
}
#spinButton:disabled {
    background: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------- */
/* 5. Form & Button Styles (PRIORITY SWAP IMPLEMENTED) */
/* ------------------------------------------------------------------- */

.btn {
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: var(--transition-medium);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* * IMPORTANT CHANGE: .btn-primary now has the RED (Secondary) visual style. 
 * This is the button used in forms/main actions that you want LESS priority on.
 */
.btn-primary {
    background-color: transparent; /* Use a hollow/outline style */
    color: var(--btn-visual-secondary); /* Neon Red text */
    border: 1px solid var(--btn-visual-secondary); /* Neon Red outline */
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.4);
}

.btn-primary:hover {
    background-color: rgba(255, 0, 85, 0.1); /* Light red background on hover */
    box-shadow: 0 0 15px var(--btn-visual-secondary), inset 0 0 5px rgba(255, 0, 85, 0.5);
    transform: translateY(-2px);
}

/* * IMPORTANT CHANGE: .btn-secondary now has the BLUE (Primary) visual style.
 * This is the button you want to be visually PRIMARY. 
 */
.btn-secondary {
    background-color: var(--btn-visual-primary); /* Solid Neon Blue fill */
    color: var(--bg-dark); /* Dark text for contrast */
    border: 1px solid var(--btn-visual-primary);
    box-shadow: 0 0 15px var(--btn-visual-primary), inset 0 0 10px rgba(255,255,255,0.8);
    transform: translateZ(5px);
}

.btn-secondary:hover {
    background-color: var(--text-light); /* White/Light background on hover */
    color: var(--bg-dark); 
    box-shadow: 0 0 30px var(--btn-visual-primary), 0 0 10px var(--btn-visual-secondary); 
    transform: translateZ(10px) translateY(-2px);
}

/* Form inputs (used in createweb.html) - adjusted for contrast */
input[type="text"], 
input[type="password"],
select {
    padding: 10px;
    background-color: rgba(23, 29, 36, 0.9); /* Slightly more opaque for input contrast */
    border: 1px solid var(--neon-blue);
    border-radius: 6px;
    color: var(--text-light);
    width: 100%;
    transition: var(--transition-fast);
}

input[type="text"]:focus, 
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--neon-red);
    box-shadow: 0 0 5px var(--neon-red);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

/* ------------------------------------------------------------------- */
/* 6. Utility and Animation (Unchanged) */
/* ------------------------------------------------------------------- */

/* Footer */
.footer {
    padding: 15px 20px;
    background-color: var(--bg-medium-glass); /* Glass BG */
    backdrop-filter: var(--glass-blur);
    color: var(--text-muted);
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
}

/* Message Box (replaces alert()) */
.message-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(20, 20, 20, 0.95);
    color: var(--text-light);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--neon-red);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.7);
    z-index: 1000;
    display: none;
    text-align: center;
    max-width: 90vw;
}

/* Code Rain Background - MUCH LESS OPACITY */
.falling-words-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
    opacity: 0.05; /* Dramatically reduced opacity for subtlety */
}

.code-column {
    position: absolute;
    white-space: pre;
    color: rgba(0, 240, 255, 0.7);
    font-family: monospace;
    font-size: 14px;
    line-height: 1.2;
}

@keyframes fall-and-loop {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* Animated Text Effects */
.animated-text span {
    display: inline-block;
    opacity: 0;
    animation: bounceIn 0.5s forwards;
    transform: translateY(20px);
}

@keyframes bounceIn {
    0% { opacity: 0; transform: translateY(40px) scale(0.8); }
    70% { opacity: 1; transform: translateY(-5px) scale(1.05); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------------------------------------------------------- */
/* 7. Responsive Media Queries (Mobile Menu Fix Retained) */
/* ------------------------------------------------------------------- */

@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }
    
    /* MOBILE SIDEBAR FIX: Slide in from the left, using Glass BG */
    .sidebar {
        position: fixed;
        top: 66px; 
        left: 0;
        width: 75%; 
        max-width: 300px;
        height: calc(100% - 66px);
        z-index: 600;
        
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        border-right: 1px solid var(--neon-blue);
        /* Ensure glass properties are applied for mobile view too */
        background-color: var(--bg-medium-glass); 
        backdrop-filter: var(--glass-blur);
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }
    
    .hamburger-menu {
        display: block;
        color: var(--neon-blue);
        font-size: 1.5rem;
        cursor: pointer;
        order: -1;
        margin-right: 20px;
    }
    .header {
        justify-content: flex-start;
    }
    .logo {
        margin-right: auto;
    }
    .main-content-wrapper {
        padding: 20px 10px;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    /* RESPONSIVE TABLE OVERRIDES (Retained) */
    .data-table {
        min-width: 100%;
    }

    .data-table th, 
    .data-table td {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .data-table tbody td:first-child {
        width: 60%;
    }
    .data-table tbody td.value {
        width: 40%;
    }
}

@media (min-width: 769px) {
    .hamburger-menu {
        display: none;
    }
}