/* =========================================
   HOMES: NEURAL DECK - STYLESHEET (V5.2)
   Theme: Cyberpunk / Dark Mode
   ========================================= */

:root {
    /* --- COLOR PALETTE --- */
    --bg-color: #0a0a0a;
    --card-bg: #111111;
    --sidebar-bg: #0f0f0f;
    
    --text-primary: #e0e0e0;
    --text-secondary: #666;
    
    --accent-color: #00ff9d;       /* Neon Green */
    --accent-hover: #00cc7a;
    --accent-visual: #bd00ff;      /* Neon Purple */
    
    --border-color: #333;
    
    /* --- DIMENSIONS --- */
    --sidebar-width: 300px;
    --mobile-header-height: 60px;
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden; /* Prevent full page scroll on desktop */
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #050505;
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
}

/* =========================================
   LAYOUT STRUCTURE
   ========================================= */

.app-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* =========================================
   SIDEBAR MODULES
   ========================================= */

.brand h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.highlight {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.mini-card {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    background: #000;
}

.mini-card input, .mini-card select {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: var(--accent-color);
    padding: 5px;
    font-size: 0.8rem;
    border-radius: 0;
    outline: none;
}

.mini-card input:focus, .mini-card select:focus {
    border-color: var(--accent-color);
}

.history-section {
    flex: 1;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.history-item {
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.8rem;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.history-item:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(0, 255, 157, 0.05);
}

.history-item.active {
    background: var(--accent-color);
    color: #000;
    font-weight: bold;
}

.mini-play-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    padding: 0;
    cursor: pointer;
}

.mini-play-btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 5px var(--accent-color);
}

/* =========================================
   MAIN CONTENT MODULES
   ========================================= */

header {
    text-align: center;
    margin-bottom: 30px;
}

.status-bar {
    font-size: 0.7rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-color);
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.output-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
}

textarea {
    flex: 1;
    min-height: 400px;
    background: #000;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 20px;
    resize: none;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* =========================================
   CONTROLS & BUTTONS
   ========================================= */

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    background: #000;
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px;
    font-size: 1rem;
}

button {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 12px 24px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
}

button:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
}

button:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

.small-btn {
    padding: 4px 12px;
    font-size: 0.7rem;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--accent-visual);
    color: var(--accent-visual);
    font-size: 0.8rem;
}

.secondary-btn:hover {
    background: rgba(189, 0, 255, 0.1);
    box-shadow: 0 0 10px rgba(189, 0, 255, 0.2);
}

/* =========================================
   AUDIO & VISUAL MODULES
   ========================================= */

/* Sliders */
.audio-settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #333;
}

.setting-row {
    margin-bottom: 10px;
}

.setting-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.setting-row span { color: var(--accent-color); }

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    margin-top: -5px;
    box-shadow: 0 0 5px var(--accent-color);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: #333;
}

/* Audio Toolbar */
.audio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #050505;
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 10px;
    margin-top: 10px;
}

.icon-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 80px;
    justify-content: center;
}

/* Visualizer */
.audio-visualizer {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.bar {
    width: 4px;
    height: 100%;
    background-color: var(--accent-color);
    animation: equalizer 0.5s infinite ease-in-out alternate;
}
.bar:nth-child(2n) { animation-duration: 0.4s; }
.bar:nth-child(3n) { animation-duration: 0.6s; }
.bar:nth-child(4n) { animation-duration: 0.3s; }

@keyframes equalizer {
    0% { height: 20%; opacity: 0.3; }
    100% { height: 100%; opacity: 1; box-shadow: 0 0 5px var(--accent-color); }
}

/* Visual Zone (Purple) */
.visual-zone {
    border-color: var(--accent-visual);
    min-height: 100px;
}
.visual-zone .card-header span { color: var(--accent-visual); }
.visual-zone button {
    border-color: var(--accent-visual);
    color: var(--accent-visual);
}
.visual-zone button:hover {
    background: var(--accent-visual);
    color: #000;
    box-shadow: 0 0 10px rgba(189, 0, 255, 0.4);
}
.visual-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #ccc;
    white-space: pre-wrap;
}

/* =========================================
   ANIMATIONS & UTILITIES
   ========================================= */

.hidden { display: none !important; }

@keyframes pulse-glow {
    0% { box-shadow: 0 0 5px var(--accent-color); opacity: 1; }
    50% { box-shadow: 0 0 20px var(--accent-color); opacity: 0.7; }
    100% { box-shadow: 0 0 5px var(--accent-color); opacity: 1; }
}

.processing {
    animation: pulse-glow 1.5s infinite ease-in-out;
    cursor: wait !important;
    background: var(--accent-hover) !important;
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #222;
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast.show {
    visibility: visible;
    animation: fadeIn 0.5s, fadeOut 0.5s 2.5s;
    opacity: 1;
}

.toast.error {
    background-color: #301010;
    border-color: #ff4d4d;
    color: #ffcbcb;
}

@keyframes fadeIn {
    from {
        bottom: 0;
        opacity: 0;
    }
    to {
        bottom: 20px;
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        bottom: 20px;
        opacity: 1;
    }
    to {
        bottom: 0;
        opacity: 0;
    }
}

/* =========================================
   RESPONSIVE DESIGN (MOBILE)
   ========================================= */

@media (max-width: 768px) {
    body { overflow: auto; }
    
    .app-layout {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 15px;
    }

    .history-section { max-height: 200px; }

    .main-content { padding: 15px; }

    .input-group { flex-direction: column; }
    
    .input-group button { 
        width: 100%; 
        padding: 15px; /* Larger touch target */
    }

    textarea { min-height: 300px; }

    .audio-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 15px;
    }

    .audio-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .icon-btn {
        width: 100%;
        padding: 12px;
        min-height: 44px;
    }

    .audio-visualizer {
        justify-content: center;
        margin-top: 5px;
        height: 30px;
    }
}
