/* Estilos compartidos para el apartado "Dart Fundamentos" (Sintaxis, Colecciones, Funciones, Asincronia/Streams, POO en Dart, Extras) */
.example-article {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.breadcrumb {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #0175C2;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.example-title {
    font-size: 2.2rem;
    color: #0175C2;
    margin-bottom: 1rem;
    font-weight: 300;
}

.example-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.demo-section, .explanation-section, .concepts-section, .exercise-section, .navigation-section {
    margin-bottom: 3rem;
}

.demo-section h2, .explanation-section h2, .concepts-section h2, .exercise-section h2 {
    color: #0175C2;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 800px) {
    .demo-container { grid-template-columns: 1fr; }
}

.code-output {
    background: #1e1e2e;
    border-radius: 8px;
    padding: 1.5rem;
    color: #f1f1f1;
}

.code-output h3 { color: #f1c40f; margin-bottom: 1rem; font-size: 1rem; }

.results-grid, .result-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.result-card {
    background: rgba(255,255,255,0.06);
    border-left: 3px solid #0175C2;
    border-radius: 4px;
    padding: 0.7rem 1rem;
}

.result-card .operation { font-size: 0.8rem; color: #bdc3c7; text-transform: uppercase; letter-spacing: 0.05em; }
.result-card .result { font-family: 'Courier New', monospace; font-size: 0.95rem; margin-top: 0.2rem; word-break: break-word; }

.result-card.error { border-left-color: #e74c3c; }
.result-card.success { border-left-color: #2ecc71; }
.result-card.warning { border-left-color: #f39c12; }

.interactive-demo { background: #f8f7fb; border-radius: 8px; padding: 1.5rem; }
.interactive-demo h3 { margin-bottom: 1rem; color: #2c3e50; }

.demo-form .form-group { margin-bottom: 1rem; }
.demo-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; color: #2c3e50; font-size: 0.92rem; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
    font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #0175C2; outline: none; }

.demo-button {
    background: #0175C2;
    color: white;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.demo-button:hover { background: #01579B; }

.quick-buttons, .badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.quick-btn {
    background: white;
    border: 2px solid #0175C2;
    color: #0175C2;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.quick-btn:hover { background: #0175C2; color: white; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-ok { background: #d4f8e8; color: #16794a; }
.badge-fail { background: #fbdada; color: #c0392b; }
.badge-warn { background: #fdf0d5; color: #a5690a; }
.badge-info { background: #e3ecfa; color: #2464b4; }

.code-breakdown { margin-top: 1.5rem; }
.code-block { margin-bottom: 1.5rem; }
.code-block h3 { color: #2c3e50; margin-bottom: 0.8rem; }
pre {
    background: #1e1e2e;
    color: #f1f1f1;
    padding: 1.2rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.5;
}
code { font-family: 'Courier New', monospace; }
.demo-form code, .exercise code, p code { background: #e3f2fd; color: #01579B; padding: 0.1rem 0.4rem; border-radius: 4px; }

.explanation-points { display: flex; flex-direction: column; gap: 1.5rem; }
.explanation-point { border-left: 3px solid #ecf0f1; padding-left: 1.2rem; }
.explanation-point h4 { color: #2c3e50; margin-bottom: 0.5rem; }
.code-line { background: #f8f7fb; padding: 0.8rem 1rem; border-radius: 6px; margin-bottom: 0.6rem; }

.concept-box {
    background: #e3f2fd;
    border-left: 4px solid #0175C2;
    padding: 0.9rem 1.2rem;
    border-radius: 6px;
    margin-top: 0.6rem;
}
.concept-box h5 { color: #0175C2; margin-bottom: 0.4rem; }

.concepts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.concept-card {
    background: #f8f7fb;
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
    border-top: 3px solid #0175C2;
}
.concept-card h3 { color: #2c3e50; margin-bottom: 0.6rem; }
.concept-card ul { padding-left: 1.2rem; color: #555; }
.concept-card li { margin-bottom: 0.3rem; }

.exercise { background: #f8f7fb; border-radius: 8px; padding: 1.5rem; }
.exercise h3 { color: #2c3e50; margin-bottom: 0.6rem; }
.exercise ol { padding-left: 1.4rem; }
.exercise li { margin-bottom: 0.4rem; }

.toggle-button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
}
.toggle-button:hover { background: #1a252f; }

.solution-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.solution-content.expanded { max-height: 3000px; margin-top: 1rem; }
.solution { margin-bottom: 1rem; }
.solution h4 { color: #0175C2; margin-bottom: 0.4rem; }

.nav-buttons { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.nav-button {
    color: #0175C2;
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border: 2px solid #0175C2;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.nav-button:hover { background: #0175C2; color: white; }

/* Tabla estilo PDO */
.pdo-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.pdo-table th, .pdo-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid #ecf0f1; text-align: left; font-size: 0.9rem; }
.pdo-table th { color: #0175C2; }
.pdo-table .delete-btn { color: #e74c3c; background: none; border: none; cursor: pointer; font-weight: 600; }

/* Modo oscuro básico (coherente con darktheme.css del sitio) */
html.dark-theme .example-article,
html.dark-theme .interactive-demo,
html.dark-theme .exercise,
html.dark-theme .concept-card { background: #1b1b26 !important; }
html.dark-theme .form-input, html.dark-theme .form-select, html.dark-theme .form-textarea { background: #2a2a38; border-color: #444; color: #eee; }
html.dark-theme .concept-box { background: #241d2c; }
