:root {
    --primary: #007aff;
    --primary-dark: #0056b3;
    --uv-orange: #ff6600;
    --accent: #00f2fe;
    --bg-dark: #111418;
    --bg-card: #1c2128;
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --glass: rgba(28, 33, 40, 0.8);
    --border: rgba(255, 255, 255, 0.12);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

#practicas {
    scroll-margin-top: 50px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Header --- */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.glass-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
}

.uv-text {
    color: var(--uv-orange);
}

.etse-text {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--uv-orange);
}

/* --- Hero --- */
.hero {
    padding: 7rem 0 3rem;
    background: radial-gradient(circle at top right, rgba(0, 122, 255, 0.1), transparent 40%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    max-width: 500px;
}

.professor-hero {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent);
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.5);
}

.hero-image img {
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
}

/* --- Practicas Section --- */
.practicas-grid {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    position: relative;
    transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.card-tag {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.card.active .card-tag {
    background: rgba(0, 255, 0, 0.1);
    color: #4cd964;
}

.card.locked .card-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.card-icon {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.card-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Footer --- */
.footer {
    background: #000;
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-info h4 {
    color: var(--uv-orange);
    margin-bottom: 0.5rem;
}

.footer-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-professor p {
    font-size: 1.1rem;
}

.footer-links p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-up-delay {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-fade-up-more {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* --- Responsive --- */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-badges {
        justify-content: center;
    }

    .subtitle {
        margin: 0 auto 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Guide Styles (Laboratorios) --- */
.guide-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.guide-card h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

.code-block {
    background: #0d1117;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
    margin: 1.5rem 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.code-block pre {
    color: #e6edf3;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.table-container {
    margin: 2rem 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
    font-weight: 600;
}

.note {
    border-left: 4px solid var(--uv-orange);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.grid-ops {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.op-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.op-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.op-card h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.op-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Code Tabs --- */
.code-tabs {
    margin-bottom: 1rem;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.op-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.op-box h3 {
    color: var(--uv-orange);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.op-box .code-block {
    margin: 1rem 0 0 0;
    padding: 1rem;
    font-size: 0.85rem;
    /* Ajuste para evitar desbordes */
    flex-grow: 1;
}

@media (max-width: 850px) {
    .grid-ops {
        grid-template-columns: 1fr;
    }
}

/* --- Simulator Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 2% auto;
    padding: 2rem;
    border: 1px solid var(--border);
    width: 95%;
    max-width: 1100px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.close-modal {
    position: absolute;
    right: 2rem;
    top: 1.5rem;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.close-modal:hover {
    color: #fff;
}

.sim-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    align-items: start;
}

.sim-controls {
    grid-column: 1;
    grid-row: 1 / 3;
}

.sim-display {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.sim-scope {
    grid-column: 2;
    grid-row: 2;
}

.sim-controls h3,
.reg-state h3,
.sim-display h3,
.sim-scope h3 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ctrl-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-toggle,
.btn-pulse {
    background: var(--bg-dark);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-body);
    min-width: 80px;
    transition: all 0.2s;
}

.btn-toggle:hover,
.btn-pulse:hover {
    background: rgba(0, 122, 255, 0.1);
}

.btn-toggle.active {
    background: var(--primary);
    color: white;
}

.status-indicator {
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    font-family: monospace;
    transition: all 0.1s;
}

.status-indicator.high {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}

.btn-pulse:active {
    background: var(--primary);
    color: white;
    transform: translateY(2px);
}

.bit-row {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
}

.bit-row span {
    flex: 1;
    background: #000;
    padding: 0.6rem 0;
    text-align: center;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent);
    border: 1px solid rgba(0, 242, 254, 0.1);
}

.bit-row span.active {
    background: rgba(0, 242, 254, 0.1);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

/* 7 Segment Display CSS */
.seven-seg {
    position: relative;
    width: 80px;
    height: 140px;
    background: #000;
}

.seg {
    position: absolute;
    background-color: #1a0505;
    border-radius: 4px;
    transition: background-color 0.05s, box-shadow 0.05s;
}

.seg.active {
    background-color: #ff3333;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.6);
}

/* Proporciones de segmentos */
.seg-a {
    top: 0;
    left: 10px;
    width: 60px;
    height: 8px;
}

.seg-b {
    top: 5px;
    right: 0;
    width: 8px;
    height: 60px;
}

.seg-c {
    bottom: 5px;
    right: 0;
    width: 8px;
    height: 60px;
}

.seg-d {
    bottom: 0;
    left: 10px;
    width: 60px;
    height: 8px;
}

.seg-e {
    bottom: 5px;
    left: 0;
    width: 8px;
    height: 60px;
}

.seg-f {
    top: 5px;
    left: 0;
    width: 8px;
    height: 60px;
}

.seg-g {
    top: 66px;
    left: 10px;
    width: 60px;
    height: 8px;
}

.seg-dp {
    bottom: 0;
    right: -15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.display-labels {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 2rem;
}

/* Scope Styles */
.sim-scope canvas {
    width: 100%;
    height: 220px;
    background: #050505;
    border: 1px solid #222;
    border-radius: 8px;
    display: block;
}

.scope-legend {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 0.8rem;
    font-family: monospace;
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .sim-layout {
        grid-template-columns: 1fr;
    }

    .sim-controls {
        grid-row: 2;
    }

    .sim-display {
        grid-row: 1;
    }

    .sim-scope {
        grid-row: 3;
    }
}