/* Estilos específicos para la página del Controlador */
.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: #e67e22;
    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: #e67e22;
    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: #d35400;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

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

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

/* 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: #e67e22;
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.15);
}

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

.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: #e67e22;
    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;
}

.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 #e67e22;
}

.analysis-card h3 {
    color: #e67e22;
    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: #e67e22;
    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;
}

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

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

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

.action-card h3 {
    color: #e67e22;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

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

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

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

.warning-note, .info-note {
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

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

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

/* 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;
}

.diagram-icon {
    font-size: 2.5rem;
    background: #e67e22;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-text {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

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

.integration-example {
    margin-top: 2rem;
}

/* 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: #e67e22;
    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: #fef5e7;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #e67e22;
}

/* Responsive */
@media (max-width: 768px) {
    .controlador-article {
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .controllers-overview,
    .analysis-grid,
    .actions-grid,
    .problems-grid,
    .improvements-grid {
        grid-template-columns: 1fr;
    }
    
    .integration-diagram {
        gap: 1rem;
    }
    
    .diagram-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .code-example pre {
        padding: 1rem;
    }
    
    .code-header {
        padding: 0.5rem;
    }
}

/* Resaltado de sintaxis PHP */
.php-tag { color: #e74c3c; font-weight: bold; }
.php-keyword { color: #9b59b6; font-weight: bold; }
.php-comment { color: #27ae60; font-style: italic; }
.php-string { color: #e67e22; }
.php-variable { color: #3498db; }
.php-function { color: #2980b9; }
.php-class { color: #8e44ad; font-weight: bold; }
.php-namespace { color: #16a085; }