/* Variables y reseteo */
:root {
    --primary-color: #0078D4; /* Azul Windows */
    --primary-hover: #005A9E;
    --bg-color: #F3F4F6;
    --sidebar-bg: #FFFFFF;
    --text-main: #333333;
    --text-light: #666666;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --warning-color: #F59E0B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* Layout Principal */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), #10B981);
    box-shadow: 0 10px 22px rgba(0, 120, 212, 0.22);
}

.brand-mark::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
}

.brand-mark::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 17px;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #FFFFFF;
}

.brand-chip {
    position: absolute;
    right: 7px;
    width: 8px;
    height: 2px;
    border-radius: 999px;
    background: #FFFFFF;
}

.brand-chip-top {
    top: 14px;
}

.brand-chip-bottom {
    bottom: 14px;
}

.brand-kicker {
    margin: 0 0 2px;
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.12rem;
    line-height: 1.15;
}

#module-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    border-radius: 0;
    background: transparent;
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
}

.nav-group-title:hover {
    background-color: #F9FAFB;
}

.nav-subgroup-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px 10px 28px;
    border-radius: 0;
    background: #FFFFFF;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
}

.nav-subgroup-title:hover {
    background-color: #F9FAFB;
}

.nav-title {
    min-width: 0;
}

.nav-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 1rem;
    line-height: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background 0.2s;
}

.nav-child {
    padding-left: 34px;
    font-size: 0.95rem;
}

.nav-item:hover {
    background-color: #F9FAFB;
}

.nav-item.active {
    background-color: #EBF5FF;
    border-left-color: var(--primary-color);
    font-weight: bold;
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Contenido Principal */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

header {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-bar {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.quick-link:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.quick-link:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.content-area {
    flex-grow: 1;
    background: #FFFFFF;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.module {
    display: none;
    animation: fadeIn 0.4s;
}

.module.active {
    display: block;
}

.module h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.module p, .module li {
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.module ul, .module ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

/* Botones */
button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #E5E7EB;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #D1D5DB;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    padding-bottom: 30px;
}

/* Tarjetas de Información */
.info-card {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 5px solid;
}

.beginner-tip {
    background-color: #EBF5FF;
    border-color: var(--primary-color);
}

.warning-tip {
    background-color: #FEF3C7;
    border-color: var(--warning-color);
}

/* Checklist */
.checklist-container {
    background: #F9FAFB;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.checklist-container label {
    display: block;
    margin: 12px 0;
    font-size: 1.1rem;
    cursor: pointer;
}

.checklist-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

/* Simulador y Errores */
.simulator-box {
    background: #F3F4F6;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px dashed #CBD5E1;
}

.simulator-box select {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.sim-result {
    margin-top: 15px;
    font-weight: bold;
    color: var(--primary-color);
}

.error-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.error-card {
    background: #FEF2F2;
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid #EF4444;
}

.media-panel {
    margin: 22px 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #FFFFFF;
}

.media-panel img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.media-panel figcaption {
    margin: 0;
    padding: 12px 14px;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.4;
    background: #F9FAFB;
}

.cable-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.cable-section h2 {
    margin-bottom: 14px;
    color: var(--primary-color);
    font-size: 1.45rem;
}

.wiring-grid,
.cable-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 20px 0;
}

.wiring-card,
.cable-types article,
.steps-panel {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #FFFFFF;
    padding: 18px;
}

.wiring-card figcaption {
    margin-bottom: 14px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
}

.rj45-diagram {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    padding: 14px;
    border: 2px solid #CBD5E1;
    border-radius: 8px;
    background: linear-gradient(#F8FAFC, #E5E7EB);
}

.pin {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 110px;
    padding-bottom: 8px;
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 4px;
    color: #111827;
    font-size: 0.78rem;
    font-weight: 800;
}

.green {
    background: #16A34A;
    color: #FFFFFF;
}

.orange {
    background: #F97316;
    color: #FFFFFF;
}

.blue {
    background: #2563EB;
    color: #FFFFFF;
}

.brown {
    background: #92400E;
    color: #FFFFFF;
}

.stripe-green {
    background: repeating-linear-gradient(90deg, #FFFFFF 0 9px, #16A34A 9px 18px);
}

.stripe-orange {
    background: repeating-linear-gradient(90deg, #FFFFFF 0 9px, #F97316 9px 18px);
}

.stripe-blue {
    background: repeating-linear-gradient(90deg, #FFFFFF 0 9px, #2563EB 9px 18px);
}

.stripe-brown {
    background: repeating-linear-gradient(90deg, #FFFFFF 0 9px, #92400E 9px 18px);
}

.wire-list {
    margin-top: 14px;
}

.wire-list li {
    margin-bottom: 8px;
    font-size: 0.98rem;
}

.cable-types article {
    background: #F9FAFB;
}

.cable-types h3,
.steps-panel h3 {
    margin-bottom: 10px;
    color: var(--text-main);
}

.security-visual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.security-illustration {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #FFFFFF;
}

.screen-graphic {
    position: relative;
    min-height: 210px;
    padding: 34px;
    background:
        linear-gradient(135deg, rgba(0,120,212,0.16), rgba(16,185,129,0.18)),
        #F8FAFC;
}

.screen-top {
    height: 18px;
    margin-bottom: 28px;
    border-radius: 999px;
    background: #CBD5E1;
}

.scan-shield {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 84px;
    margin: 0 auto 20px;
    clip-path: polygon(50% 0, 88% 15%, 82% 72%, 50% 100%, 18% 72%, 12% 15%);
    background: var(--success-color);
    color: #FFFFFF;
    font-size: 2rem;
    font-weight: 800;
}

.scan-lines span,
.tool-row {
    display: block;
    height: 12px;
    margin: 10px auto;
    border-radius: 999px;
    background: #94A3B8;
}

.scan-lines span:nth-child(1) {
    width: 72%;
}

.scan-lines span:nth-child(2) {
    width: 58%;
}

.scan-lines span:nth-child(3) {
    width: 66%;
}

.manual-clean {
    background:
        linear-gradient(135deg, rgba(245,158,11,0.18), rgba(0,120,212,0.12)),
        #F8FAFC;
}

.tool-row {
    width: 76%;
}

.tool-row.short {
    width: 54%;
}

.clean-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 22px auto 0;
    border-radius: 50%;
    background: var(--warning-color);
    color: #FFFFFF;
    font-size: 2rem;
    font-weight: 800;
}

.security-illustration figcaption {
    margin: 0;
    padding: 12px 14px;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.4;
    background: #F9FAFB;
}

.hardware-gallery,
.hardware-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 22px 0;
}

.hardware-grid article {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #F9FAFB;
    padding: 18px;
}

.hardware-grid h3 {
    margin-bottom: 10px;
    color: var(--text-main);
}

.hardware-grid p {
    margin-bottom: 0;
    font-size: 1rem;
}

.component-photo {
    overflow: hidden;
    margin: 0 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #FFFFFF;
}

.component-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.component-photo figcaption {
    margin: 0;
    padding: 8px 10px;
    background: #FFFFFF;
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.35;
}

.component-photo a {
    color: var(--text-light);
}

.command-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
}

.command-section h2 {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1.35rem;
}

.command-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 18px 0 8px;
}

.command-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.command-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 108, 189, 0.22);
    box-shadow: var(--shadow-md);
}

.command-card code {
    display: inline-block;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(15, 108, 189, 0.18);
    border-radius: 6px;
    background: #F3F8FD;
    color: var(--text-main);
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.98rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.command-card p {
    margin: 10px 0 0;
    color: var(--text-light);
    font-size: 0.98rem;
}

.contact-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
}

.copy-command {
    flex: 0 0 auto;
    min-width: 96px;
}

.copy-command.copied {
    border-color: rgba(16, 185, 129, 0.38);
    background: #ECFDF5;
    color: #047857;
}

/* Quiz */
.quiz-question {
    margin-bottom: 20px;
}
.quiz-question h4 {
    margin-bottom: 10px;
}
.quiz-options label {
    display: block;
    margin-bottom: 8px;
}

.section-quiz {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.section-quiz > h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.section-quiz .quiz-submit {
    margin-top: 8px;
}

.section-quiz .quiz-result {
    display: none;
    margin-top: 15px;
}

/* Mobile */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        transform: translateX(100%);
    }

    #open-sidebar {
        background: none;
        border: 1px solid var(--border-color);
        padding: 8px 12px;
        color: var(--text-main);
        align-self: flex-start;
    }

    .top-bar {
        align-items: flex-start;
        justify-content: space-between;
    }

    .quick-links {
        flex: 1;
    }

    .quick-link {
        flex: 1 1 130px;
        padding: 9px 12px;
        font-size: 0.9rem;
    }

    .wiring-grid,
    .cable-types,
    .security-visual-grid,
    .hardware-gallery,
    .hardware-grid,
    .command-grid {
        grid-template-columns: 1fr;
    }

    .command-card {
        align-items: stretch;
        flex-direction: column;
    }

    .copy-command {
        width: 100%;
    }

    .pin {
        min-height: 82px;
        font-size: 0.72rem;
    }

    .rj45-diagram {
        gap: 3px;
        padding: 10px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modern UI polish */
:root {
    --primary-color: #0F6CBD;
    --primary-hover: #0B4F8A;
    --bg-color: #EEF2F7;
    --sidebar-bg: rgba(255, 255, 255, 0.86);
    --text-main: #172033;
    --text-light: #667085;
    --border-color: #D9E2EC;
    --surface: #FFFFFF;
    --surface-soft: #F8FAFC;
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.10);
    --ring: 0 0 0 3px rgba(15, 108, 189, 0.18);
}

body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 242, 247, 0.92)),
        linear-gradient(135deg, rgba(15, 108, 189, 0.06), rgba(18, 165, 148, 0.04)),
        var(--bg-color);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.38), transparent 72%);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(217, 226, 236, 0.9);
    backdrop-filter: blur(18px);
    box-shadow: 14px 0 34px rgba(15, 23, 42, 0.06);
}

.sidebar-header {
    padding: 22px 18px;
    background: rgba(255, 255, 255, 0.64);
}

.brand-mark {
    border-radius: 8px;
    background: linear-gradient(135deg, #0F6CBD 0%, #12A594 100%);
    box-shadow: 0 12px 26px rgba(15, 108, 189, 0.24);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand:hover .brand-mark {
    transform: translateY(-2px) rotate(-2deg);
    box-shadow: 0 16px 34px rgba(15, 108, 189, 0.30);
}

#module-nav {
    padding: 14px 10px;
}

.nav-group-title,
.nav-subgroup-title,
.nav-item {
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-group-title {
    margin: 4px 0;
    padding: 13px 12px;
}

.nav-subgroup-title {
    margin: 4px 0 4px 8px;
    padding: 11px 12px;
    background: rgba(15, 108, 189, 0.06);
}

.nav-item {
    margin: 4px 0 4px 8px;
    border-left: 0;
    background: transparent;
}

.nav-child {
    padding-left: 22px;
}

.nav-group-title:hover,
.nav-subgroup-title:hover,
.nav-item:hover {
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(15, 108, 189, 0.14), rgba(18, 165, 148, 0.10));
    color: var(--primary-color);
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.nav-toggle {
    background: #FFFFFF;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, background 0.2s ease;
}

.nav-group-title:hover .nav-toggle,
.nav-subgroup-title:hover .nav-toggle {
    transform: rotate(90deg);
    background: #EBF5FF;
}

.main-content {
    max-width: 900px;
    padding: 0 20px;
}

header {
    min-height: 28px;
}

.content-area {
    border: 1px solid rgba(217, 226, 236, 0.88);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.module.active {
    animation: fadeIn 0.35s ease both;
}

.module h1 {
    position: relative;
    padding-bottom: 14px;
    color: var(--text-main);
    font-size: 2rem;
    letter-spacing: 0;
}

.module h1::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), #12A594);
}

.info-card,
.checklist-container,
.simulator-box,
.error-card,
.media-panel,
.wiring-card,
.cable-types article,
.steps-panel,
.security-illustration,
.hardware-grid article,
.component-photo {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.media-panel:hover,
.wiring-card:hover,
.cable-types article:hover,
.steps-panel:hover,
.security-illustration:hover,
.hardware-grid article:hover,
.component-photo:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(15, 108, 189, 0.22);
}

.beginner-tip {
    background: linear-gradient(135deg, rgba(15, 108, 189, 0.11), rgba(18, 165, 148, 0.08));
}

.warning-tip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(255, 255, 255, 0.84));
}

.checklist-container label {
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.checklist-container label:hover {
    background: #FFFFFF;
    transform: translateX(2px);
}

.checklist-container input[type="checkbox"] {
    accent-color: var(--primary-color);
}

button {
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #12A594);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #0E8F81);
}

.btn-secondary {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
}

button:focus-visible,
.nav-item:focus-visible,
.nav-group-title:focus-visible,
.nav-subgroup-title:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.nav-buttons {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -20px;
    padding: 14px 20px 24px;
    background: linear-gradient(180deg, rgba(238, 242, 247, 0), rgba(238, 242, 247, 0.96) 34%);
    backdrop-filter: blur(12px);
}

.media-panel img,
.component-photo img {
    transition: transform 0.35s ease, filter 0.35s ease;
}

.media-panel:hover img,
.component-photo:hover img {
    transform: scale(1.025);
    filter: saturate(1.04) contrast(1.02);
}

.screen-graphic,
.rj45-diagram {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100%;
        backdrop-filter: blur(16px);
    }

    .main-content {
        padding: 0 16px;
    }

    .content-area {
        padding: 22px;
    }

    .module h1 {
        font-size: 1.58rem;
    }

    .nav-buttons {
        margin: 0 -16px;
        padding: 12px 16px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Uniform card sizing */
.info-card,
.checklist-container,
.simulator-box,
.error-card,
.media-panel,
.wiring-card,
.cable-types article,
.steps-panel,
.security-illustration,
.hardware-grid article {
    width: 100%;
    padding: 18px;
}

.media-panel,
.security-illustration,
.component-photo {
    padding: 0;
}

.wiring-grid,
.cable-types,
.security-visual-grid,
.hardware-gallery,
.hardware-grid {
    align-items: stretch;
}

.wiring-card,
.cable-types article,
.security-illustration,
.hardware-grid article {
    display: flex;
    flex-direction: column;
}

.hardware-grid article p,
.cable-types article p {
    flex-grow: 1;
}

.component-photo {
    width: 100%;
    margin: 0 0 14px;
}

.component-photo img {
    aspect-ratio: 16 / 9;
}

.screen-graphic {
    min-height: 180px;
}

.pin {
    min-height: 92px;
}
