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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

/* Header común */
.main-header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-container {
    height: 60px;
}

.main-logo {
    height: 100%;
    width: auto;
}

.user-info, .user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Botones */
.btn-primary, .btn-secondary, .btn-logout, .btn-nav {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
}

.btn-logout:hover {
    background-color: #c0392b;
}

.btn-nav {
    background-color: #ecf0f1;
    color: #333;
}

.btn-nav:hover:not(:disabled) {
    background-color: #bdc3c7;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Contenedor principal */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; vertical-align: middle; word-break: break-word; }
.table th:not(:last-child), .table td:not(:last-child) { border-right: 1px solid #e5e7eb; }
.table thead th { text-align: left; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.table tbody tr { border-bottom: 1px solid #e5e7eb; }
.table tbody tr:nth-child(odd) { background: #ffffff; }
.table tbody tr:nth-child(even) { background: #f8fafc; }
/* Anchuras mínimas para Teléfono (4ª) y País (5ª) */
.table thead th:nth-child(4), .table thead th:nth-child(5),
.table tbody td:nth-child(4), .table tbody td:nth-child(5) { min-width: 120px; }

.theme-dark .table thead th { background: #111827; border-color: #1f2937; color: #e5e7eb; }
.theme-dark .table tbody tr { border-color: #1f2937; }
.theme-dark .table tbody tr:nth-child(odd) { background: #0f172a; }
.theme-dark .table tbody tr:nth-child(even) { background: #0b1220; }
.theme-dark .table td, .theme-dark .table th { color: #e5e7eb; }
.theme-dark .table th:not(:last-child), .theme-dark .table td:not(:last-child) { border-right: 1px solid #1f2937; }

.theme-dark select { background-color: #111827; color: #e5e7eb; border: 1px solid #374151; }
.theme-dark .btn-secondary { background-color: #374151; color: #e5e7eb; }
.theme-dark .btn-secondary:hover { background-color: #4b5563; }

/* Formularios */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.error-message {
    color: #e74c3c;
    margin-top: 0.5rem;
    display: none;
}

/* Estilos para la barra de navegación */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .logo-container {
        height: 50px;
    }
    
    .user-info, .user-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-primary, .btn-secondary, .btn-logout, .btn-nav {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

.theme-dark { background-color: #0b1220; color: #e5e7eb; }
.theme-dark .main-header { background-color: #0f172a; color: #e5e7eb; box-shadow: none; }
.theme-dark .welcome-content h1 { color: #e5e7eb; }
.theme-dark .welcome-content p { color: #cbd5e1; }
.theme-dark .login-section { background-color: #0f172a; box-shadow: none; border: 1px solid #1f2937; }
.theme-dark .login-section h2 { color: #e5e7eb; }
.theme-dark .form-group label { color: #e5e7eb; }
.theme-dark .form-group input { background-color: #111827; border: 1px solid #374151; color: #e5e7eb; }
.theme-dark .error-message { color: #f87171; }
.theme-dark .btn-nav { background-color: #1f2937; color: #e5e7eb; }
.theme-dark .btn-nav:hover:not(:disabled) { background-color: #374151; }
.theme-dark .carousel { background: #0f172a; box-shadow: none; }
.theme-dark .carousel-prev, .theme-dark .carousel-next { background: rgba(255,255,255,0.15); }
.theme-dark .whatsapp-button { background-color: #22c55e; box-shadow: 0 4px 12px rgba(34,197,94,0.4); }
.theme-dark .hero-section { background-color: #111827; box-shadow: none; }
.theme-dark .course-sidebar, .theme-dark .video-container { background-color: #0f172a; }
.theme-dark .chapter-title { background-color: #1f2937; color: #e5e7eb; }
.theme-dark .video-item:hover { background-color: #1f2937; }
.theme-dark .video-item.active { background-color: #0b172a; border-left-color: #60a5fa; }
.theme-dark .btn-primary { background-color: #2563eb; }
.theme-dark .btn-primary:hover { background-color: #1d4ed8; }
