/* Estilos específicos para la página del Controlador de Coches */
.controlador-article {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    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;
}

.article-title {
    font-size: 2.2rem;
    color: #3498db;
    margin-bottom: 1rem;
    font-weight: 300;
}

.article-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.navigation-buttons.bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #ecf0f1;
}

.nav-btn {
    background: #3498db;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    color: #3498db;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.content-section h3 {
    color: #2980b9;
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem 0;
}

/* Overview de controladores */
.controllers-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.controller-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e1e8ed;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.controller-card:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.controller-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #3498db;
}

.controller-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.controller-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.controller-card p {
    color: #7f8c8d;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.controller-type {
    background: #3498db;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Estilos para código */
.code-example {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.code-example.small {
    margin: 0.5rem 0;
    max-height: 200px;
    overflow-y: auto;
}

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

.file-name {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.copy-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.3);
}

.code-example pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-example code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #2c3e50;
}

/* Grid para análisis */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.analysis-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.analysis-card h3 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Análisis de métodos */
.methods-analysis {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.method-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.method-section h3 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.method-explanation {
    margin-top: 1rem;
}

.method-explanation p {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.method-explanation ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.method-explanation li {
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

/* Grid para acciones */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.action-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.action-card.dangerous {
    border-left: 4px solid #e74c3c;
}

.action-card h3 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-card.dangerous h3 {
    color: #e74c3c;
}

.action-analysis {
    margin-top: 1rem;
}

.action-analysis p {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.action-analysis ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.action-analysis li {
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.warning-note, .info-note, .success-note {
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-note {
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.info-note {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    color: #004085;
}

.success-note {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Diagrama de integración */
.integration-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.diagram-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.diagram-icon {
    font-size: 2.5rem;
    background: #3498db;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.diagram-item:hover .diagram-icon {
    transform: scale(1.1);
}

.diagram-text {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    max-width: 100px;
}

.diagram-arrow {
    font-size: 1.5rem;
    color: #3498db;
    font-weight: bold;
}

/* Ejemplo de integración */
.integration-example {
    margin-top: 2rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.integration-example h3 {
    margin-top: 0;
    color: #3498db;
}

.code-connection {
    display: flex;
    align-items: stretch;
    gap: 2rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.xml-side, .php-side {
    flex: 1;
    min-width: 300px;
}

.xml-side h4, .php-side h4 {
    text-align: center;
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.connection-arrow {
    font-size: 2rem;
    color: #3498db;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

/* Buenas prácticas */
.best-practices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.practice-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.practice-card h3 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Demo de flujo */
.flow-demo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.demo-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #ebf5fb;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.demo-step:hover {
    transform: translateX(5px);
}

.step-number {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.step-content p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

.demo-controls {
    text-align: center;
    margin-top: 2rem;
}

.demo-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.demo-note {
    margin-top: 1rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Grid para problemas */
.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.problem {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.problem h3 {
    color: #3498db;
    margin-top: 0;
}

/* Grid para mejoras */
.improvements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.improvement {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.improvement h3 {
    color: #27ae60;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Sección de troubleshooting */
.troubleshooting {
    background: #ebf5fb;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.controlador-article {
    animation: fadeIn 0.5s ease;
}

/* Efectos especiales para controladores */
.controller-card, .action-card, .practice-card {
    animation: fadeIn 0.6s ease;
}

/* Resaltado especial para código de controladores */
.php-keyword { color: #9b59b6; }
.php-class { color: #8e44ad; font-weight: bold; }
.php-function { color: #2980b9; }
.php-string { color: #e67e22; }
.php-comment { color: #27ae60; font-style: italic; }
.php-variable { color: #3498db; }