/* psmt/style.css - Cozy Cyber Soundboard Styles */

:root {
    --bg-color: #0b0813;
    --card-bg: rgba(22, 17, 39, 0.5);
    --border-color: rgba(147, 112, 219, 0.15);
    --primary-glow: rgba(147, 112, 219, 0.4);
    --text-color: #e5e0f0;
    --text-muted: #a59ebd;
    --accent-color: #ff9d6c; /* Cozy orange */
    --accent-glow: rgba(255, 157, 108, 0.35);
    
    --mint-color: #00f5d4; /* Vivid neon mint */
    --purple-color: #7b2cbf;
    --pink-color: #ff007f;
    --blue-color: #00b4d8;
    --danger-color: #ff3366;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- CYBER DECORATIVE GRID --- */
.cyber-grid-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(147, 112, 219, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(147, 112, 219, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    mix-blend-mode: screen;
    pointer-events: none;
}

.ambient-glow-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--purple-color) 0%, transparent 70%);
}

.ambient-glow-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
}

/* --- LOADING SCREEN --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #06040a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.8s;
    padding: 20px;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-container {
    max-width: 550px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Pulsating Vinyl Disk */
.vinyl-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 30px;
}

.vinyl-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, #18122b 0%, #0d081f 25%, #05030a 35%, #000000 100%);
    border: 6px solid #161026;
    box-shadow: 
        0 0 30px rgba(147, 112, 219, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 3s linear infinite;
}

.vinyl-disc::before {
    content: '';
    position: absolute;
    top: 15%; left: 15%; right: 15%; bottom: 15%;
    border-radius: 50%;
    border: 1px double rgba(255, 255, 255, 0.05);
}

.vinyl-disc::after {
    content: '';
    position: absolute;
    top: 30%; left: 30%; right: 30%; bottom: 30%;
    border-radius: 50%;
    border: 2px dashed rgba(147, 112, 219, 0.2);
}

.vinyl-label {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.vinyl-center-hole {
    width: 12px;
    height: 12px;
    background-color: #06040a;
    border-radius: 50%;
    box-shadow: inset 0 0 4px rgba(255,255,255,0.4);
}

/* Pulsating ambient wave behind vinyl */
.vinyl-wave {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    opacity: 0;
    pointer-events: none;
    animation: pulseWave 2s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
}

.vinyl-wave-2 {
    animation-delay: 0.6s;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes pulseWave {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

.loading-title {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    color: var(--text-color);
}

.loading-subtitle {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-color);
    margin-bottom: 25px;
    letter-spacing: 1px;
}

/* Progress bar container */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--purple-color), var(--accent-color), var(--mint-color));
    border-radius: 20px;
    box-shadow: 0 0 12px var(--accent-color);
    transition: width 0.15s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-weight: bold;
}

/* Terminal Log Display */
.loading-logs {
    width: 100%;
    height: 130px;
    background-color: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 15px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    text-align: left;
    color: var(--text-muted);
    line-height: 1.6;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.6);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.loading-logs::-webkit-scrollbar {
    width: 4px;
}
.loading-logs::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.log-entry {
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.log-entry.success {
    color: var(--mint-color);
}
.log-entry.info {
    color: var(--blue-color);
}

/* Loaded Trigger Button */
.btn-enter-soundboard {
    display: none;
    margin-top: 20px;
    padding: 14px 28px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 800;
    color: #0b0813;
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffbe88 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 
        0 4px 15px var(--accent-glow),
        0 0 25px rgba(255, 157, 108, 0.4);
    transition: var(--transition);
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.btn-enter-soundboard:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 6px 20px var(--accent-glow),
        0 0 35px rgba(255, 157, 108, 0.6);
}

.btn-enter-soundboard:active {
    transform: translateY(1px);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- MAIN CONTAINER --- */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.main-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Glass Card Global Styles */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Header Styles */
header.header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title-area {
    display: flex;
    flex-direction: column;
}

.header-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.header-logo span.highlight {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--mint-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* Search Bar styling */
.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 18px 12px 42px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 30px;
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 157, 108, 0.2);
    background-color: rgba(0,0,0,0.5);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

/* --- VISUALIZER DASHBOARD --- */
.visualizer-card {
    padding: 24px 30px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.visualizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.visualizer-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.visualizer-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Live reactive Canvas */
.canvas-container {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.03);
}

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

/* Master Control Ribbon */
.master-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 20px;
    z-index: 2;
}

.master-buttons {
    display: flex;
    gap: 12px;
}

.btn-master {
    padding: 10px 20px;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-stop-all {
    background-color: rgba(255, 51, 102, 0.15);
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: var(--danger-color);
}

.btn-stop-all:hover {
    background-color: var(--danger-color);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

.btn-random {
    background: rgba(123, 44, 191, 0.15);
    border: 1px solid rgba(123, 44, 191, 0.3);
    color: #d8b4fe;
}

.btn-random:hover {
    background-color: var(--purple-color);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(123, 44, 191, 0.4);
}

.master-vol-slider {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
}

.master-vol-slider span {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

/* Common Slider Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    transition: background 0.3s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Firefox compatibility for range sliders */
input[type="range"]::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: transform 0.1s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* --- SOUNDBOARD BUTTONS GRID --- */
.soundboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.sound-button {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    user-select: none;
    overflow: hidden;
    color: var(--text-color);
    width: 100%;
}

.sound-button::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

/* Key Hover State */
.sound-button:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: var(--key-color, var(--accent-color));
    box-shadow: 
        0 8px 30px var(--key-glow, rgba(255, 157, 108, 0.25)),
        inset 0 0 15px rgba(255, 255, 255, 0.02);
}

.sound-button:hover::after {
    opacity: 1;
}

/* Active/Trigger State */
.sound-button:active {
    transform: scale(0.96);
}

/* Hotkey Trigger Flash Effect */
.sound-button.active-flash {
    animation: buttonFlash 0.4s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
}

@keyframes buttonFlash {
    0% {
        border-color: var(--key-color);
        box-shadow: 0 0 35px var(--key-glow);
        transform: scale(1.04);
    }
    100% {
        transform: scale(1);
    }
}

/* Active Playing State */
.sound-button.playing {
    border-color: var(--key-color);
    box-shadow: 
        0 0 25px var(--key-glow),
        inset 0 0 15px var(--key-glow);
    animation: keyPulse 1.2s infinite alternate;
}

@keyframes keyPulse {
    0% { opacity: 0.9; }
    100% { opacity: 1; filter: brightness(1.15); }
}

.btn-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    z-index: 2;
    letter-spacing: 0.5px;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* --- FOOTER & BACK BUTTON --- */
.back-btn-container {
    text-align: center;
    margin-top: 20px;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: rgba(22, 17, 39, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-color);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-back-home:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 157, 108, 0.2);
    transform: translateY(-2px);
}

footer.footer-panel {
    text-align: center;
    margin-top: 60px;
    padding: 20px 0;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
    header.header-panel {
        padding: 16px 20px;
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .visualizer-card {
        padding: 16px 20px;
        margin-bottom: 20px;
    }
    
    .master-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .master-vol-slider {
        min-width: 100%;
    }
    
    .soundboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .sound-button {
        aspect-ratio: auto;
        min-height: 68px;
        padding: 12px 14px;
        border-radius: 12px;
    }
    
    .btn-title {
        font-size: 14px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }
    
    .main-wrapper {
        padding: 20px 16px;
    }
    
    footer.footer-panel {
        margin-top: 40px;
    }
}
