/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--light-bg);
    scroll-behavior: smooth;
}

/* Navegación */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Contenido principal */
.main-content {
    margin-top: 80px;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    margin-bottom: 4rem;
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--warning-color);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Perfiles de usuario */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.profile-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.profile-header {
    padding: 2rem;
    text-align: center;
    color: var(--white);
    position: relative;
}

.profile-header.operador {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
}

.profile-header.supervisor {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.profile-header.hse-manager {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.profile-header i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.profile-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-content {
    padding: 2rem;
}

.profile-content h4 {
    color: var(--gray-700);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.profile-content ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.profile-content li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-content li i {
    color: var(--success-color);
    width: 20px;
}

.profile-restrictions {
    border-top: 1px solid var(--gray-200);
    padding-top: 1.5rem;
}

.profile-restrictions li i {
    color: var(--danger-color);
}

.profile-full-access {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.profile-full-access i {
    color: var(--warning-color);
    margin-right: 0.5rem;
}

/* Procesos */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.process-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.process-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.process-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.process-icon i {
    font-size: 2rem;
    color: var(--white);
}

.process-card h3 {
    color: var(--gray-800);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.process-card p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Guías */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.guide-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-left: 4px solid var(--info-color);
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.guide-icon {
    width: 60px;
    height: 60px;
    background: var(--info-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.guide-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.guide-card h3 {
    color: var(--gray-800);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.guide-card p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray-600);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-2px);
}

/* Títulos de sección */
h2 {
    color: var(--gray-800);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

h2 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Footer */
.footer {
    background: var(--gray-800);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section h4 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 1rem;
    text-align: center;
    color: var(--gray-400);
}

/* Configuration Styles */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.config-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.config-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.config-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.config-header i {
    font-size: 1.5rem;
}

.config-content {
    padding: 1.5rem;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.config-table th,
.config-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.config-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--gray-800);
}

.config-table code {
    background: #f1f3f4;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Security Styles */
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.security-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.security-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.security-content {
    padding: 1.5rem;
}

.role-permissions {
    display: grid;
    gap: 1.5rem;
}

.role-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.role-item h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.role-item ul {
    list-style: none;
    padding: 0;
}

.role-item li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

/* Status Badges */
.status-active {
    background: #27ae60;
    color: white;
}

.status-maintenance {
    background: #f39c12;
    color: white;
}

.status-inactive {
    background: #95a5a6;
    color: white;
}

.status-locked {
    background: #e74c3c;
    color: white;
}

.status-pending {
    background: #3498db;
    color: white;
}

.status-expired {
    background: #e67e22;
    color: white;
}

.status-released {
    background: #27ae60;
    color: white;
}

.status-emergency {
    background: #c0392b;
    color: white;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.25rem;
}

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

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

.energy-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 500;
}

/* API Documentation Styles */
.api-section {
    margin: 2rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.api-endpoints {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.api-method {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 60px;
    text-align: center;
}

.api-method.get {
    background: #27ae60;
    color: white;
}

.api-method.post {
    background: #3498db;
    color: white;
}

.api-method.put {
    background: #f39c12;
    color: white;
}

.api-method.delete {
    background: #e74c3c;
    color: white;
}

.api-path {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--gray-800);
    flex: 1;
}

.api-description {
    color: #666;
    font-size: 0.9rem;
}

.code-block {
    margin: 1rem 0;
    background: #2c3e50;
    border-radius: 8px;
    overflow: hidden;
}

.code-block h4 {
    background: #34495e;
    color: white;
    padding: 1rem;
    margin: 0;
    font-size: 1rem;
}

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

.code-block code {
    color: #ecf0f1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.data-structure {
    margin: 2rem 0;
}

.error-codes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.error-codes-table th,
.error-codes-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.error-codes-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.error-code {
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Installation Styles */
.install-steps {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.install-step {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.step-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.step-content ul {
    list-style: none;
    padding: 0;
}

.step-content li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-content li i {
    color: var(--primary-color);
    width: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .profile-grid,
    .process-grid,
    .guide-grid {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .security-grid {
        grid-template-columns: 1fr;
    }
    
    .energy-types {
        grid-template-columns: 1fr;
    }
    
    .install-step {
        flex-direction: column;
        gap: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        margin-top: 120px;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .feature-card,
    .profile-card,
    .process-card,
    .guide-card {
        padding: 1.5rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.6s ease-out;
}

/* Utilidades */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}