/* 
  Theme: Industrial Synth / Cyber-Deck
  Aesthetic: Tactile, Technical, Dark, High-Contrast
*/

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Color Palette */
    --surface-base: #111111;
    --surface-panel: #1a1a1a;
    --surface-inset: #0a0a0a;

    --accent-primary: #FF5C00;
    /* Amber LED / Safety Orange */
    --accent-secondary: #00D1FF;
    /* Electric Blue / OSD */
    --accent-error: #FF003C;

    --text-primary: #EEEEEE;
    --text-muted: #888888;
    --text-dim: #444444;

    --border-dim: #333333;
    --border-highlight: #555555;

    /* Typography */
    --font-display: 'Chakra Petch', sans-serif;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing & Layout */
    --grid-unit: 4px;
    --radius-sm: 2px;
    --radius-md: 4px;

    /* Effects */
    --glow-primary: 0 0 10px rgba(255, 92, 0, 0.3);
    --glow-secondary: 0 0 8px rgba(0, 209, 255, 0.3);
}

/* Reset & Base */
body {
    background-color: var(--surface-base);
    color: var(--text-primary);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    background: var(--surface-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dim);
    border: 1px solid var(--surface-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Navbar / Top Deck */
.navbar {
    background-color: var(--surface-panel) !important;
    border-bottom: 1px solid var(--border-dim);
    padding: 1rem 0;
}

.navbar-brand {
    color: var(--accent-primary) !important;
    font-size: 1.5rem;
    text-shadow: var(--glow-primary);
}

/* Inputs & Forms */
.form-control {
    background-color: var(--surface-inset);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 12px;
}

.form-control:focus {
    background-color: var(--surface-inset);
    border-color: var(--accent-secondary);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--accent-secondary), var(--glow-secondary);
}

.form-label {
    font-family: var(--font-display);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-control::placeholder {
    color: var(--text-dim);
    font-family: var(--font-ui);
}

/* Sound Grid Cards */
#grid {
    padding-bottom: 120px;
    /* Space for footer */
}

/* Custom Card Style mimicking "Modules" */
.sound-card {
    background-color: var(--surface-panel);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 16px;
    position: relative;
    transition: all 0.1s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sound-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

.sound-card::before {
    /* Screw/Rivet detail */
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 4px;
    height: 4px;
    background-color: var(--border-dim);
    border-radius: 50%;
}

.sound-card h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    padding-right: 15px;
}

.sound-card .btn-play {
    width: 100%;
    margin-top: 1rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
}

.sound-btn {
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    margin: 1rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Base do Botão "Físico" */
    background: linear-gradient(145deg, #ff6a13, #e65200);
    color: white;
    font-weight: bold;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);

    /* Efeito de Borda/Anel Metálico e Profundidade */
    border: none;
    box-shadow:
        /* Borda interna (brilho superior) */
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        /* Borda interna (sombra inferior) */
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        /* Sombra projetada do botão (altura) */
        0 4px 8px rgba(0, 0, 0, 0.4),
        /* Anel externo escuro (moldura) */
        0 0 0 4px var(--surface-panel),
        /* Sombra externa da moldura */
        0 0 0 5px var(--border-dim);

    /* Transição suave para interação física */
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.sound-btn::before {
    /* Brilho especular (reflexo de luz) */
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 60%;
    height: 40%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

.sound-btn:hover {
    background: linear-gradient(145deg, #ff7f33, #f55a00);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.5),
        /* Sombra aumenta ao levantar */
        0 0 0 4px var(--surface-panel),
        0 0 0 5px var(--border-highlight);
    /* Moldura acende levemente */
    text-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
}

.sound-btn:active,
.sound-btn.active {
    background: linear-gradient(145deg, #cc4900, #ff5c00);
    transform: translateY(2px);
    /* Botão afunda fisicamente */
    box-shadow:
        /* Sombras internas fortes simulando profundidade/ônus */
        inset 0 3px 6px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        /* Sombra externa reduzida (botão próximo à base) */
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 0 0 4px var(--surface-panel),
        0 0 0 5px var(--border-dim);
    border: none;
    /* Garante que não apareça borda padrão */
}

/* Buttons */
.btn-primary,
.btn-outline-primary {
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: all 0.1s;
}

.btn-primary {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--surface-base);
}

.btn-primary:hover,
.btn-primary:active {
    background-color: #ff7733;
    border-color: #ff7733;
    color: var(--surface-base);
    box-shadow: var(--glow-primary);
}

.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--accent-primary);
    color: var(--surface-base);
    box-shadow: var(--glow-primary);
}

/* Player Bar / Control Deck */
.player-bar {
    background-color: var(--surface-base) !important;
    border-top: 2px solid var(--border-dim) !important;
    padding: 1rem 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* The Screen Area in the player */
.player-screen {
    background-color: var(--surface-inset);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

/* Scanline effect */
.player-screen::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

#nowTitle {
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    font-size: 0.9rem;
    text-shadow: var(--glow-secondary);
    z-index: 1;
}

/* Progress Bar */
.progress {
    height: 4px;
    background-color: var(--surface-base);
    border-radius: 0;
    margin-top: 6px;
    overflow: visible;
}

.progress-bar {
    background-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -3px;
    width: 4px;
    height: 10px;
    background-color: #fff;
    box-shadow: 0 0 5px #fff;
}

/* Play/Pause Button in Footer */
#playPause {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Physical knob/button style */
    border: 2px solid var(--accent-primary);
    background: radial-gradient(circle, var(--surface-panel) 0%, var(--surface-base) 100%);
    color: var(--accent-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

#playPause:active {
    transform: scale(0.95);
    background: var(--accent-primary);
    color: var(--surface-base);
}

#time {
    font-family: var(--font-mono);
    color: var(--text-muted);
}

#totalCount {
    color: var(--accent-secondary);
}

/* Playing State Animation for cards */
.playing-card {
    border-color: var(--accent-primary) !important;
    background-color: rgba(255, 92, 0, 0.05);
    box-shadow: inset 0 0 20px rgba(255, 92, 0, 0.1);
}

.playing-title {
    color: var(--accent-primary) !important;
}

/* Helper Text */
.text-muted {
    color: var(--text-muted) !important;
}