* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.simulator-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.control-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    height: fit-content;
}

.control-panel h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.control-section {
    margin-bottom: 25px;
}

.control-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.status-indicators {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
}

.status-label {
    font-weight: 500;
    color: #4a5568;
}

.status-value {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.status-value.energized {
    background: #c6f6d5;
    color: #22543d;
}

.status-value.deenergized {
    background: #fed7d7;
    color: #742a2a;
}

.switch-controls, .seccionador-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.switch-btn, .seccionador-btn {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.switch-btn:hover, .seccionador-btn:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.switch-btn.closed, .seccionador-btn.closed {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.switch-btn.open, .seccionador-btn.open {
    background: #f56565;
    color: white;
    border-color: #e53e3e;
}

.procedure-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.procedure-btn {
    padding: 12px 20px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.procedure-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.procedure-btn:active {
    transform: translateY(0);
}

.system-diagram {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.system-diagram h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.diagram-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px dashed #cbd5e0;
}

#system-canvas {
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.logs-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.logs-panel h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.logs-container {
    max-height: 300px;
    overflow-y: auto;
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
}

.log-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #4299e1;
    font-size: 0.9rem;
}

.log-time {
    color: #718096;
    font-weight: 500;
    min-width: 80px;
}

.log-message {
    color: #2d3748;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .simulator-container {
        grid-template-columns: 1fr;
    }
    
    .switch-controls, .seccionador-controls {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .switch-controls, .seccionador-controls {
        grid-template-columns: 1fr;
    }
    
    .diagram-container {
        min-height: 300px;
    }
    
    #system-canvas {
        width: 100%;
        height: auto;
    }
}

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

.status-value.energized {
    animation: pulse 2s infinite;
}

/* Scrollbar personalizado */
.logs-container::-webkit-scrollbar {
    width: 8px;
}

.logs-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Botón de Ayuda */
.help-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-left: 20px;
}

.help-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Modal de Ayuda */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: scale(1.2);
    color: #ff6b6b;
}

.modal-body {
    padding: 30px;
    line-height: 1.6;
}

.modal-body h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.modal-body h4 {
    color: #34495e;
    margin: 25px 0 15px 0;
    font-size: 18px;
}

.procedure-info ol {
    background: rgba(255, 255, 255, 0.7);
    padding: 20px 30px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    margin: 15px 0;
}

.procedure-info li {
    margin: 10px 0;
    color: #2c3e50;
    font-weight: 500;
}

.safety-info ul {
    background: rgba(255, 193, 7, 0.1);
    padding: 20px 30px;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
    margin: 15px 0;
}

.safety-info li {
    margin: 10px 0;
    color: #2c3e50;
}

.component-info ul {
    background: rgba(40, 167, 69, 0.1);
    padding: 20px 30px;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    margin: 15px 0;
}

.component-info li {
    margin: 10px 0;
    color: #2c3e50;
}

.component-info strong {
    color: #667eea;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .procedure-info ol,
    .safety-info ul,
    .component-info ul {
        padding: 15px 20px;
    }
}

/* Botón de Información Técnica */
.info-btn {
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 206, 162, 0.3);
    margin-left: 10px;
}

.info-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 206, 162, 0.4);
}

/* Modal de Información Técnica */
#info-modal .modal-content {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2dfdb 100%);
    border-radius: 15px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(24, 90, 157, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

#info-modal .info-header {
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#info-modal .modal-body {
    padding: 30px;
    line-height: 1.6;
}

#info-modal h3 {
    color: #185a9d;
    margin-bottom: 18px;
    font-size: 20px;
    border-bottom: 2px solid #43cea2;
    padding-bottom: 8px;
}

#info-modal ul {
    background: rgba(67, 206, 162, 0.08);
    padding: 18px 28px;
    border-radius: 10px;
    border-left: 4px solid #43cea2;
    margin: 15px 0 25px 0;
}

#info-modal li {
    margin: 10px 0;
    color: #185a9d;
    font-weight: 500;
}

#info-modal strong {
    color: #185a9d;
}

@media (max-width: 768px) {
    #info-modal .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    #info-modal .info-header {
        padding: 15px 20px;
    }
    #info-modal .modal-body {
        padding: 20px;
    }
    #info-modal ul {
        padding: 12px 15px;
    }
}

/* Estilos para el menú principal moderno */
.main-menu {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.main-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.menu-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.menu-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    margin-bottom: 1.5rem;
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5)); }
    100% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)); }
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: #718096;
    margin-bottom: 1rem;
}

.menu-description {
    font-size: 1.1rem;
    color: #4a5568;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

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

.tablero-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tablero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.tablero-card:hover::before {
    left: 100%;
}

.tablero-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #667eea;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.tablero-card h4 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.tablero-card p {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.5;
}

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

.info-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

.info-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.info-btn:hover::before {
    left: 100%;
}

.info-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.info-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-weight: 500;
}

.menu-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.footer-text {
    color: #718096;
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive design para el menú */
@media (max-width: 768px) {
    .menu-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .tablero-buttons {
        grid-template-columns: 1fr;
    }
    
    .info-buttons {
        grid-template-columns: 1fr;
    }
    
    .logo-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .main-menu {
        padding: 1rem;
    }
    
    .menu-container {
        padding: 1.5rem 1rem;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .menu-description {
        font-size: 1rem;
    }
}

.boton-tablero {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    margin: 6px 4px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: background 0.2s, transform 0.1s;
    outline: none;
}

.boton-tablero:hover, .boton-tablero:focus {
    background: #1565c0;
    transform: translateY(-2px) scale(1.04);
}

.tablero-layout {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
}

.tablero-diagrama {
    flex: 1 1 60%;
    min-width: 350px;
}

.tablero-controles {
    flex: 1 1 40%;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tablero-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tablero-controls-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 2px solid #e2e8f0;
    width: 100%;
    max-width: 400px;
}

.tablero-controls-container h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.tablero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.menu-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    outline: none;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

@media (max-width: 900px) {
    .tablero-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .tablero-diagrama, .tablero-controles {
        min-width: 0;
        width: 100%;
    }
    .tablero-controls-container {
        max-width: 100%;
    }
} 