/* signals.css */

:root {
    --bg-main: #0a0e1a;
    --bg-card: #111827;
    --accent-purple: #bf00ff;
    --accent-cyan: #00f5ff;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --code-bg: rgba(0, 0, 0, 0.4);

    /* Unit Colors */
    --mod1-color: #00f5ff;
    /* Cyan */
    --mod2-color: #00ff88;
    /* Green */
    --mod3-color: #facc15;
    /* Gold */
    --mod4-color: #f97316;
    /* Orange */
    --mod5-color: #bf00ff;
    /* Purple */
    --mod6-color: #fb7185;
    /* Rose */
    --mod7-color: #60a5fa;
    /* Blue */
    --mod8-color: #34d399;
    /* Teal */
    --mod9-color: #a78bfa;
    /* Violet */
    --mod10-color: #fbbf24;
    /* Amber */
}

body[data-page-category="signals"] {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* Base Layout (resembling microprocessor.css) */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: rgba(10, 14, 26, 0.95);
    border-right: 1px solid rgba(0, 245, 255, 0.1);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 2rem;
    padding: 0 1rem;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.nav-link.active {
    background: rgba(0, 245, 255, 0.1);
    color: var(--accent-cyan);
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 3rem;
}

.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

/* Sections & Cards */
.module-section {
    margin-bottom: 5rem;
    scroll-margin-top: 80px;
}

.module-header {
    margin-bottom: 2rem;
}

.module-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
}

.module-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.module-line {
    height: 3px;
    width: 100px;
    margin-top: 10px;
    border-radius: 2px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
}

.machine-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.card-strip {
    height: 4px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 1px;
    margin: 0;
}

/* Formula & Anim Zones */
.formula-zone {
    padding: 1.5rem;
    flex: 1;
    background: #0d1117;
}

.anim-zone {
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    min-height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Typography & Math */
.formula {
    background: rgba(0, 245, 255, 0.05);
    border-left: 3px solid var(--accent-cyan);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    overflow-x: auto;
}

.katex-display {
    margin: 0 !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        padding: 2rem;
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(0, 245, 255, 0.1);
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .formula {
        font-size: 0.95rem;
    }
}