/* Shared Styles - Used across all tool pages */
/* Include this file in index.html, midifier.html, and sampler.html */
/* Color variables are defined per-page in inline <style> tags */

/* CSS Variables - Radii Scale, Typography Contrast, and Theming */
:root {
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    --text-muted: rgba(255, 255, 255, 0.68);
}

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

/* Accessible Focus Ring */
:focus-visible {
    outline: 2px solid var(--accent-primary, var(--header-accent, #00f5ff));
    outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.btn:focus-visible,
.tool-link:focus-visible,
.sample-pad:focus-visible {
    outline: 2px solid var(--accent-primary, var(--header-accent, #00f5ff));
    outline-offset: 2px;
}

/* Base Body Styles */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-black, #050505);
    color: var(--text-white, #FFFFFF);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Main Container */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    margin-top: 80px;
}

/* Tool Header (page title section) */
header.tool-header {
    text-align: left;
    margin-bottom: 3rem;
    padding-left: 1rem;
}

/* H1 Title - Gray gradient text */
h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(3rem, 10vw, 5.5rem);
    line-height: 0.95;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -3px;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, 0.2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtitle */
.subtitle {
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 4px;
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-lg, 24px);
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Primary Button */
.btn {
    background: linear-gradient(180deg, var(--accent-primary, #d946ef) 0%, var(--accent-purple, #26014b) 100%);
    color: white;
    border: none;
    padding: 16px 45px;
    border-radius: var(--radius-pill, 9999px);
    font-weight: 400;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Righteous', sans-serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Tool Navigation (bottom nav for 5 tools) */
.tool-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 20, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 8px 16px;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    max-width: 92vw;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.tool-nav::-webkit-scrollbar {
    display: none;
}

.tool-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 2px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-pill, 9999px);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tool-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.tool-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

/* Color-coded active and hover states */
.tool-link[href="index.html"]:hover,
.tool-link[href="index.html"].active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.25);
}

.tool-link[href="stemer.html"]:hover,
.tool-link[href="stemer.html"].active {
    color: #d8b4fe;
    background: rgba(168, 85, 247, 0.18);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.35);
}

.tool-link[href="midifier.html"]:hover,
.tool-link[href="midifier.html"].active {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.18);
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.35);
}

.tool-link[href="sampler.html"]:hover,
.tool-link[href="sampler.html"].active {
    color: #7dd3fc;
    background: rgba(0, 168, 255, 0.18);
    border-color: rgba(0, 168, 255, 0.5);
    box-shadow: 0 0 14px rgba(0, 168, 255, 0.35);
}

.tool-link[href="mixter.html"]:hover,
.tool-link[href="mixter.html"].active {
    color: #86efac;
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.tool-link[href="master.html"]:hover,
.tool-link[href="master.html"].active {
    color: #f472b6;
    background: rgba(236, 72, 153, 0.18);
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.35);
}

.tool-link[href="generator.html"]:hover,
.tool-link[href="generator.html"].active {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}

/* Sample Pad Grid for Sampler */
.pad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.sample-pad {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md, 14px);
    padding: 1.25rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.sample-pad:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.sample-pad:active,
.sample-pad.playing {
    transform: scale(0.96);
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}

.sample-pad .pad-num {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.sample-pad.playing .pad-num {
    color: #000;
}

.sample-pad .pad-name {
    font-family: 'Righteous', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Audio metrics badges */
.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill, 9999px);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.metric-pill strong {
    color: var(--accent-primary);
}

/* Placeholder/Setup Message */
.setup-placeholder {
    border: 2px dashed var(--glass-border, rgba(255, 255, 255, 0.2));
    border-radius: var(--radius-lg, 24px);
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
}


.setup-placeholder h3 {
    margin-bottom: 1rem;
    color: var(--text-white, #fff);
}

/* Gradio/iframe embed */
#gradio-app {
    width: 100%;
    min-height: 500px;
    border: none;
    border-radius: var(--radius-lg, 24px);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
        margin-top: 90px;
    }

    header.tool-header {
        padding-left: 0;
        margin-bottom: 2rem;
    }

    h1 {
        letter-spacing: -2px;
        margin-bottom: 1rem;
    }

    .subtitle {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .glass-card {
        padding: 1.5rem;
        border-radius: var(--radius-md, 14px);
    }

    .btn {
        padding: 12px 30px;
        font-size: 0.75rem;
    }

    .tool-nav {
        padding: 8px 15px;
        gap: 15px;
    }

    .tool-link {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }
}