﻿/* Estilos específicos para el módulo de Variables en Java */

.tutorial-article {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #ecf0f1;
    position: relative;
}

.article-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 300;
}

.article-subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.module-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 8px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: bold;
}

.badge-number {
    font-size: 1.5rem;
    line-height: 1;
}

.badge-text {
    font-size: 0.8rem;
    opacity: 0.9;
}

.module-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateX(-5px);
}

.nav-link.next:hover {
    transform: translateX(5px);
}

.content-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.content-section:last-child {
    border-bottom: none;
}

.content-section h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Introducción a Variables */
.variable-explanation {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.analogy {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
}

.analogy-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.analogy-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.analogy-text h4 {
    margin: 0 0 0.5rem 0;
    color: white;
}

.analogy-visual {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.variable-box {
    border-radius: 8px;
    width: 150px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    position: relative;
}

.variable-box:hover {
    transform: translateY(-5px);
}

.variable-box[data-type="int"] {
    border-top: 4px solid #3498db;
}

.variable-box[data-type="String"] {
    border-top: 4px solid #e74c3c;
}

.variable-box[data-type="double"] {
    border-top: 4px solid #27ae60;
}

.box-label {
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.box-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.data-type {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-family: 'Courier New', monospace;
}

.data-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
}

.box-memory {
    font-size: 0.7rem;
    color: #95a5a6;
    text-align: center;
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
}

.definition {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.definition h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
}

.definition-parts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.part {
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

.part h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.part p {
    color: #666;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.part code {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Declaración de Variables */
.declaration-examples {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.example-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.example-card {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
    text-align: center;
}

.example-card h4 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.example-card p {
    color: #7f8c8d;
    margin: 0 0 1rem 0;
}

.code-example {
    background: #2c3e50;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.code-example pre {
    margin: 0;
    color: #ecf0f1;
}

.variable-state {
    margin-top: 1rem;
}

.state-diagram {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.memory-cell {
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    padding: 0.75rem;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.memory-cell.initialized {
    border-color: #27ae60;
    background: #d4edda;
}

.memory-cell.updated {
    border-color: #3498db;
    background: #d6eaf8;
    animation: pulse 1s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cell-name {
    font-weight: bold;
    color: #2c3e50;
}

.cell-type {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-family: 'Courier New', monospace;
}

.cell-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    font-family: 'Courier New', monospace;
}

.state-text {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.declaration-interactive {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #3498db;
}

.interactive-editor {
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.editor-header {
    background: #2c3e50;
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.run-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.code-input-area {
    display: flex;
    background: #1e1e1e;
    min-height: 150px;
}

.line-numbers {
    background: #2d2d2d;
    color: #858585;
    padding: 1rem 0.5rem;
    font-family: 'Courier New', monospace;
    text-align: right;
    user-select: none;
    font-size: 0.9rem;
}

.code-input {
    flex: 1;
    background: none;
    border: none;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 1rem;
    line-height: 1.5;
    resize: none;
    outline: none;
}

.memory-view {
    padding: 1rem;
    border-top: 1px solid #ecf0f1;
}

.memory-cells {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.output-panel {
    padding: 1rem;
    border-top: 1px solid #ecf0f1;
}

.output-content {
    background: #1e1e1e;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 1rem;
    border-radius: 4px;
    min-height: 60px;
    font-size: 0.9rem;
}

.placeholder {
    color: #666;
    font-style: italic;
    margin: 0;
}

.challenge {
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #f39c12;
}

.challenge h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.challenge p {
    color: #666;
    margin: 0 0 1rem 0;
}

.hint-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tipos de Datos Primitivos */
.data-types-explorer {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.types-selector {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.type-category {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.type-category h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.type-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.type-btn {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.type-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.type-btn:hover:not(.active) {
    border-color: #3498db;
    transform: translateY(-2px);
}

.type-details {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.type-detail {
    display: none;
    padding: 0;
}

.type-detail.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h3 {
    margin: 0;
    font-size: 1.8rem;
}

.type-tag {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.detail-content {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h5 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-visual {
    padding: 1rem;
    border-radius: 6px;
}

.range-bar {
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #e74c3c, #f39c12, #27ae60);
    height: 30px;
    border-radius: 15px;
    padding: 0 1rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.range-fill {
    background: rgba(255,255,255,0.3);
    height: 20px;
    border-radius: 10px;
    margin: 0 1rem;
}

.range-min, .range-max {
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

.usage-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.usage-example {
    padding: 1rem;
    border-radius: 6px;
}

.usage-example pre {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.usage-example p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

.error-example {
    background: #f8d7da;
    border-left: 4px solid #e74c3c;
    padding: 1rem;
    border-radius: 0 6px 6px 0;
}

.error-explanation {
    color: #721c24;
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
}

.bit-calculator {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    border-radius: 6px;
}

.bit-calculator label {
    display: block;
    margin-bottom: 0.5rem;
}

.number-input {
    padding: 0.5rem;
    border: 2px solid #3498db;
    border-radius: 4px;
    font-size: 1rem;
    width: 100px;
    margin-bottom: 1rem;
}

.bits-container {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.bit {
    width: 40px;
    height: 40px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.bit.active {
    background: #3498db;
    color: white;
}

.bit.negative {
    background: #e74c3c;
    color: white;
}

.bit-info {
    text-align: center;
    margin-top: 1rem;
}

.bit-info p {
    margin: 0.25rem 0;
}

.types-comparison {
    margin-top: 2rem;
}

.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.comparison-table th {
    background: #3498db;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.comparison-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.9rem;
}

.comparison-table tr:nth-child(even) {
}

.comparison-table code {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Conversión de Tipos */
.casting-explorer {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.casting-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.casting-type {
    padding: 1.5rem;
    border-radius: 8px;
    border-top: 4px solid #3498db;
}

.casting-type h4 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conversion-diagram {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.type-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.type-item {
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.type-item.small {
    background: #27ae60;
}

.type-item.large {
    background: #e74c3c;
}

.type-item.xlarge {
    background: #9b59b6;
}

.arrow {
    color: #7f8c8d;
    font-size: 1.2rem;
    font-weight: bold;
}

.warning {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    padding: 0.75rem;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.warning i {
    color: #f39c12;
}

.casting-simulator {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid #3498db;
}

.simulator-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: bold;
    color: #2c3e50;
}

.type-select {
    padding: 0.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 4px;
    font-size: 1rem;
}

.type-select:focus {
    border-color: #3498db;
    outline: none;
}

.convert-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    justify-self: start;
    align-self: end;
}

.conversion-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.conversion-step {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    min-width: 150px;
}

.step-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.step-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
}

.step-value.loss {
    color: #e74c3c;
}

.step-type {
    font-size: 0.9rem;
    color: #3498db;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.conversion-arrow {
    font-size: 2rem;
    color: #3498db;
}

.code-output {
    background: #2c3e50;
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.code-output h5 {
    color: #ecf0f1;
    margin: 0 0 1rem 0;
}

.copy-code-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Variables vs Constantes */
.variables-comparison {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comparison-visual {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
}

.variable-type {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.type-header {
    padding: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.type-header.variable {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.type-header.constant {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.type-header h4 {
    margin: 0;
    font-size: 1.3rem;
}

.type-content {
    padding: 1.5rem;
}

.type-content p {
    color: #666;
    margin: 0 0 1rem 0;
}

.example {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.use-case h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.use-case ul {
    margin: 0;
    padding-left: 1.5rem;
}

.use-case li {
    color: #666;
    margin-bottom: 0.25rem;
}

.vs-separator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-separator span {
    background: #f39c12;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.constants-game {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e74c3c;
}

.game-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}

.values-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.draggable-value {
    background: #3498db;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    cursor: move;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    user-select: none;
    transition: transform 0.3s ease;
}

.draggable-value[data-type="constant"] {
    background: #e74c3c;
}

.draggable-value:hover {
    transform: translateY(-2px);
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category {
    padding: 1rem;
    border-radius: 6px;
    border: 2px dashed #bdc3c7;
    min-height: 150px;
}

.category h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.drop-zone {
    border-radius: 4px;
    min-height: 100px;
    transition: background 0.3s ease;
}

.drop-zone.hover {
    background: #3498db20;
    border: 2px dashed #3498db;
}

.game-feedback {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#gameScore {
    font-weight: bold;
    color: #2c3e50;
}

#gameScore span {
    color: #27ae60;
}

.check-game-btn {
    background: #27ae60;
    color: white;
}

.reset-game-btn {
    background: #95a5a6;
    color: white;
}

/* Ámbito de Variables */
.scope-explorer {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.scope-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.scope-type {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #9b59b6;
}

.scope-type h4 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.scope-type p {
    color: #7f8c8d;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.scope-visual {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.code-block {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.block-line {
    margin: 0.25rem 0;
}

.indent {
    margin-left: 2rem;
}

.indent-2 {
    margin-left: 4rem;
}

.variable-highlight {
    color: #f1c40f;
    font-weight: bold;
}

.scope-area {
    padding: 1rem;
    border-radius: 6px;
    border: 2px solid #3498db;
    min-height: 100px;
    position: relative;
}

.scope-boundary {
    border: 2px dashed #e74c3c;
    border-radius: 4px;
    padding: 0.5rem;
    height: 80px;
    position: relative;
}

.scope-label {
    position: absolute;
    top: -10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.scope-variable {
    background: #3498db;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Courier New', monospace;
}

.scope-interactive {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #9b59b6;
}

.scope-editor {
    border-radius: 6px;
    overflow: hidden;
}

.editor-tabs {
    display: flex;
    background: #2c3e50;
}

.tab-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.tab-btn.active {
    background: #3498db;
}

.tab-content {
    display: none;
    padding: 1.5rem;
    min-height: 300px;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.scope-diagram {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scope-level {
    border: 2px solid;
    border-radius: 6px;
    padding: 1rem;
    position: relative;
}

.scope-level.global {
    border-color: #3498db;
}

.scope-level.method {
    border-color: #27ae60;
    margin-left: 2rem;
}

.scope-level.block {
    border-color: #e74c3c;
    margin-left: 4rem;
}

.level-label {
    position: absolute;
    top: -10px;
    left: 10px;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.variables-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.variable-item {
    padding: 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.var-name {
    color: #3498db;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.var-value {
    color: #27ae60;
    font-family: 'Courier New', monospace;
}

.execution-tracker {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
}

.execution-line {
    padding: 0.5rem;
    border-left: 3px solid transparent;
    margin: 0.25rem 0;
}

.execution-line.active {
    border-left-color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
}

.line-number {
    color: #95a5a6;
    margin-right: 1rem;
}

.step-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ejercicios Prácticos */
.exercises-container {
    border-radius: 8px;
    overflow: hidden;
}

.exercise-tabs {
    display: flex;
    background: #2c3e50;
}

.exercise-tab {
    flex: 1;
    background: none;
    border: none;
    color: #ecf0f1;
    padding: 1rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    text-align: center;
}

.exercise-tab.active {
    background: #3498db;
    font-weight: bold;
}

.exercise-content {
    padding: 0;
}

.exercise-panel {
    display: none;
    padding: 2rem;
}

.exercise-panel.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.exercise-panel h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.exercise-instructions {
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    margin: 1rem 0;
}

.exercise-instructions ol {
    margin: 0;
    padding-left: 1.5rem;
}

.exercise-instructions li {
    margin-bottom: 0.5rem;
    color: #666;
}

.exercise-editor {
    background: #1e1e1e;
    border-radius: 6px;
    margin: 1rem 0;
    overflow: hidden;
}

.exercise-code {
    width: 100%;
    min-height: 200px;
    background: none;
    border: none;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 1rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.editor-actions {
    background: #2d2d2d;
    padding: 1rem;
    display: flex;
    gap: 1rem;
}

.run-exercise-btn {
    background: #27ae60;
    color: white;
}

.solution-btn {
    background: #f39c12;
    color: white;
}

.exercise-output {
    background: #2c3e50;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 1rem;
    border-radius: 6px;
    min-height: 100px;
    margin-top: 1rem;
}

.practice-challenges {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #3498db;
    margin-top: 2rem;
}

.quiz-multiple {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.quiz-item {
    padding: 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quiz-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.quiz-item label {
    flex: 1;
    cursor: pointer;
}

.quiz-item code {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.feedback {
    min-width: 20px;
    text-align: center;
}

.check-quiz-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

/* Resumen y Buenas Prácticas */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.summary-card {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
}

.summary-card h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.summary-card li {
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.4;
}

.cheat-sheet {
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #f39c12;
    margin: 2rem 0;
}

.cheat-sheet h4 {
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cheat-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cheat-section {
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

.cheat-section h5 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.cheat-section pre {
    margin: 0;
    font-size: 0.9rem;
}

.download-cheat-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.next-module-preview {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.preview-content {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.preview-item i {
    font-size: 2rem;
}

.next-module-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
    transition: transform 0.3s ease;
}

.next-module-btn:hover {
    transform: translateY(-2px);
}

/* Test Final */
.final-test {
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid #27ae60;
}

.test-progress {
    margin-bottom: 2rem;
}

.progress-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #27ae60;
    color: white;
}

.indicator.answered {
    background: #3498db;
    color: white;
}

.test-content {
    min-height: 200px;
    margin-bottom: 2rem;
}

.test-question {
    display: none;
}

.test-question.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.test-question h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.test-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.test-options label {
    padding: 1rem;
    border-radius: 6px;
    border: 2px solid #ecf0f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.test-options label:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.test-options input[type="radio"] {
    width: 20px;
    height: 20px;
}

.test-options span {
    flex: 1;
    color: #666;
}

.test-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.prev-test-btn {
    background: #95a5a6;
    color: white;
}

.next-test-btn {
    background: #3498db;
    color: white;
}

.submit-test-btn {
    background: #27ae60;
    color: white;
}

.test-results {
    display: none;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    text-align: center;
}

/* Efectos de hover y animaciones */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Estados de validación */
.correct {
    color: #27ae60;
}

.incorrect {
    color: #e74c3c;
}

.warning {
    color: #f39c12;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}