/* Style System for Gamepad Controller Laboratory */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@500;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg-main: #080B12;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-solid: #111827;
    --border-card: rgba(255, 255, 255, 0.07);
    --primary: #7C3AED;
    --primary-glow: rgba(124, 58, 237, 0.35);
    --secondary: #00D4FF;
    --secondary-glow: rgba(0, 212, 255, 0.35);
    --success: #22C55E;
    --success-glow: rgba(34, 197, 94, 0.3);
    --warning: #F59E0B;
    --warning-glow: rgba(245, 158, 11, 0.3);
    --danger: #EF4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    
    --text-primary: #F8FAFC;
    --text-muted: #94A3B8;
}

/* Base Styles */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

h1, h2, h3, .orbitron {
    font-family: 'Orbitron', sans-serif;
}

code, pre, .mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: 1rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

.glass-card {
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(31, 41, 55, 0.6);
    border-color: rgba(124, 58, 237, 0.25);
    transform: translateY(-2px);
}

/* Neon Glow Elements */
.glow-primary {
    box-shadow: 0 0 15px var(--primary-glow);
}

.glow-secondary {
    box-shadow: 0 0 15px var(--secondary-glow);
}

.glow-success {
    box-shadow: 0 0 15px var(--success-glow);
}

.glow-text-primary {
    text-shadow: 0 0 8px var(--primary-glow);
}

.glow-text-secondary {
    text-shadow: 0 0 8px var(--secondary-glow);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0f19;
}

::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Interactive Controller SVG styling */
.controller-part {
    fill: #1f2937;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 1.5;
    transition: fill 0.1s ease, stroke 0.1s ease, filter 0.1s ease;
}

.controller-part.active-btn {
    fill: var(--primary);
    stroke: var(--secondary);
    filter: drop-shadow(0 0 4px var(--primary-glow));
}

.controller-part.active-trigger {
    fill: var(--secondary);
    stroke: var(--primary);
    filter: drop-shadow(0 0 4px var(--secondary-glow));
}

.stick-knob {
    fill: #374151;
    stroke: #4b5563;
    stroke-width: 2;
    transition: transform 0.05s ease-out;
}

/* Grid & Layout Helpers */
.grid-bg {
    background-size: 20px 20px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Animations */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
        border-color: rgba(124, 58, 237, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
        border-color: rgba(124, 58, 237, 0.5);
    }
}

.pulse-border {
    animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

.scanline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 212, 255, 0) 0%,
        rgba(0, 212, 255, 0.08) 50%,
        rgba(0, 212, 255, 0) 100%
    );
    animation: scanline 6s linear infinite;
    pointer-events: none;
}

/* Canvas overlays */
.canvas-grid {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.8);
    border-radius: 0.5rem;
}

/* Keyboard Tester Key Cap */
.key-cap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    border: 2px solid #334155;
    border-bottom-width: 4px;
    border-radius: 6px;
    color: #f1f5f9;
    font-weight: 600;
    transition: all 0.05s ease;
    cursor: default;
    user-select: none;
}

.key-cap.pressed {
    border-bottom-width: 2px;
    background: var(--primary);
    border-color: var(--secondary);
    transform: translateY(2px);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Print Layout Optimization */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    #app-container, .no-print {
        display: none !important;
    }

    #print-report-container {
        display: block !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 2rem !important;
    }
    
    .print-card {
        border: 1px solid #cccccc !important;
        background: #fafafa !important;
        page-break-inside: avoid;
        margin-bottom: 1.5rem !important;
        padding: 1rem !important;
        border-radius: 4px !important;
    }

    .print-header {
        border-bottom: 2px solid #333333 !important;
        padding-bottom: 1rem !important;
        margin-bottom: 2rem !important;
    }

    .print-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .print-score-pill {
        border: 2px solid #000000 !important;
        padding: 0.5rem 1rem !important;
        font-weight: bold !important;
        background: #eeeeee !important;
        display: inline-block !important;
    }
    
    .print-muted {
        color: #666666 !important;
    }
}

#print-report-container {
    display: none;
}
