/* public/amp-anatomy/css/amp-anatomy.css */
/* Autentyczny styl StereoLab Amp Anatomy 2.0 (Split-Screen Cybernetic Audio Circuit) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@400;500;600;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);
    margin: 1.5rem auto 3rem auto;
    width: 100%;
    max-width: 1700px;
}

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

/* Scrollbary wewnątrz aplikacji */
#sl-anatomy-app-root ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
#sl-anatomy-app-root ::-webkit-scrollbar-track {
    background: rgba(2, 6, 23, 0.5);
}
#sl-anatomy-app-root ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
#sl-anatomy-app-root ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.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: slPulse 1.5s infinite;
}

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

/* Header aplikacji */
.sl-app-header {
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10;
    gap: 15px;
    flex-wrap: wrap;
}

.sl-app-header h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.sl-app-header h1 span {
    color: var(--stage-line);
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.sl-amp-select-custom {
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 7px 32px 7px 12px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
    transition: all 0.2s ease;
    max-width: 340px;
}

.sl-amp-select-custom:hover, .sl-amp-select-custom:focus {
    border-color: var(--stage-line);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

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

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

/* Tor Sygnałowy (Signal Flow Circuit Architecture) */
.sl-flow-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 950px;
    margin: 1rem auto;
    padding: 1rem 0.5rem;
}

.sl-flow-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Dedykowany, widoczny pasek szyny sygnałowej */
.sl-signal-rail {
    position: relative;
    width: 100%;
    max-width: 820px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto;
    z-index: 5;
}

.sl-signal-line {
    position: absolute;
    left: 24px;
    right: 24px;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

/* Świecący orb sygnału */
.sl-signal-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px 4px #fff;
    z-index: 6;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sl-signal-dot.idle {
    animation: moveSignalHorizontal 4s linear infinite alternate;
}

@keyframes moveSignalHorizontal {
    0% { left: 28px; opacity: 0.35; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { left: calc(100% - 28px); opacity: 0.35; }
}

/* Karta stopnia wzmacniacza */
.sl-stage-block {
    position: relative;
    z-index: 2;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 1.35rem 1.6rem;
    margin: 0.75rem 0.5rem;
    width: 340px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}

.sl-stage-block:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 18px 35px rgba(0,0,0,0.55);
}

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

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

.sl-stage-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sl-stage-info h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0 0 4px 0;
    font-weight: 700;
    letter-spacing: -0.01em;
}

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

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

.sl-influence-fill {
    height: 100%;
    background: currentColor;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Prawy Panel Wywiadowczy (Intelligence Drawer) */
.sl-info-panel {
    width: 550px;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--panel-border);
    padding: 2.5rem 2rem;
    overflow-y: auto;
    position: relative;
    box-shadow: -12px 0 35px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

@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);
        min-height: 550px;
    }
    .sl-stage-block {
        width: 100%;
        max-width: 360px;
    }
}

.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.7rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.sl-panel-section {
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,0.03);
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.07);
}

.sl-panel-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
    font-weight: 700;
}

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

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

.sl-req-item span:first-child {
    color: var(--text-main);
    font-weight: 500;
}

.sl-action-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 13px 22px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

.sl-action-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

.sl-action-btn.secondary {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: none;
}

.sl-action-btn.secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

.sl-nav-tabs {
    display: flex;
    gap: 15px;
}

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

.sl-nav-tab.active {
    color: #fff;
    border-bottom-color: var(--stage-input);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

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

/* Karty lamp w panelu wywiadowczym */
.sl-tube-card {
    background: rgba(255,255,255,0.04);
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.07);
    transition: all 0.2s ease;
}

.sl-tube-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

/* Przycisk Skompletuj Pełny Zestaw Lamp (5% Rabatu Zestawowego) */
.sl-full-set-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0b0f19;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.sl-full-set-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    color: #000;
}

.sl-full-set-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
}

/* Modal Pełnego Zestawu Lamp */
.sl-set-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: slFadeIn 0.2s ease-out;
}

.sl-set-modal-box {
    background: #0f172a;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 18px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -15px rgba(0,0,0,0.8), 0 0 30px rgba(245, 158, 11, 0.15);
    overflow: hidden;
}

.sl-set-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(15,23,42,0.9) 0%, rgba(30,41,59,0.8) 100%);
}

.sl-set-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.sl-set-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 10px;
    gap: 12px;
}

.sl-set-item-row.missing {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
}

.sl-set-modal-footer {
    padding: 18px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(2, 6, 23, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

@keyframes slFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
