/* assets/app.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;700&display=swap');

#sl-anatomy-app-root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --stage-phono: #10b981; 
    --stage-input: #3b82f6; 
    --stage-tone: #0ea5e9;  
    --stage-line: #8b5cf6;  
    --stage-driver: #f97316; 
    --stage-pi: #eab308;    
    --stage-power: #ef4444; 
    --stage-output: #64748b; 
    
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    font-family: var(--font-body);
    background: radial-gradient(circle at center top, var(--bg-dark), var(--bg-darker));
    color: var(--text-main);
    min-height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.08);
}

#sl-anatomy-app-root * {
    box-sizing: border-box;
}

.sl-loader {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-muted);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; color: var(--stage-input); }
    100% { opacity: 0.6; }
}

.sl-app-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.sl-app-header h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.sl-app-header h1 span {
    color: var(--stage-line);
}

.sl-app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.sl-diagram-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Hi-Fi Layout (Vertical) */
.sl-hifi-layout .sl-flow-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 1rem;
    padding-bottom: 4rem;
    width: 100%;
    max-width: 600px;
}

.sl-hifi-layout .sl-signal-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: rgba(255,255,255,0.05);
    transform: translateX(-50%);
    z-index: 0;
}

/* Guitar Layout (Horizontal Grid) */
.sl-guitar-layout .sl-flow-container {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 2rem;
    width: 100%;
    padding: 2rem 0;
}

.sl-guitar-layout .sl-signal-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 4px;
    background: rgba(255,255,255,0.05);
    transform: translateY(-50%);
    z-index: 0;
}

.sl-signal-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px #fff;
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sl-hifi-layout .sl-signal-dot {
    animation: moveSignalVertical 4s linear infinite;
}

.sl-guitar-layout .sl-signal-dot {
    animation: moveSignalHorizontal 4s linear infinite;
}

@keyframes moveSignalVertical {
    0% { top: 0; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes moveSignalHorizontal {
    0% { left: 10%; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { left: 90%; opacity: 0; }
}

.sl-stage-block {
    position: relative;
    z-index: 2;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    width: 340px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}

.sl-stage-block:hover {
    transform: scale(1.03);
    border-color: rgba(255,255,255,0.3);
}

.sl-stage-block.active {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border-color: currentColor;
}

.sl-stage-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.sl-stage-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.sl-stage-info h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0 0 4px 0;
    font-weight: 600;
}

.sl-stage-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.sl-influence-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 12px;
    position: relative;
    overflow: hidden;
}

.sl-influence-fill {
    height: 100%;
    background: currentColor;
    border-radius: 2px;
}

.sl-influence-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* Specific Stage Colors dynamically set in JS using inline styles for currentColor effect */

.sl-info-panel {
    width: 550px;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--panel-border);
    padding: 2.5rem 2rem;
    overflow-y: auto;
    position: relative;
    box-shadow: -10px 0 30px rgba(0,0,0,0.4);
}

.sl-info-panel .added_to_cart {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    color: #fff !important;
    text-decoration: none !important;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.sl-info-panel .added_to_cart:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 900px) {
    .sl-app-layout {
        flex-direction: column;
    }
    .sl-info-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--panel-border);
        height: 50vh;
    }
}

.sl-panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
}

.sl-panel-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sl-panel-section {
    margin-bottom: 1.5rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.sl-panel-section h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0 0 10px 0;
}

.sl-req-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sl-req-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.sl-action-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.sl-action-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.sl-nav-tabs {
    display: flex;
    gap: 15px;
    margin-right: 2rem;
}

.sl-nav-tab {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sl-nav-tab.active {
    color: #fff;
    border-bottom-color: var(--stage-input);
}

.sl-nav-tab:hover {
    color: #fff;
}

/* SVG Definitions */
.sl-svg-defs {
    position: absolute;
    width: 0;
    height: 0;
}
