/* ========================================
   ESTILOS CONSOLIDADOS PARA HEADERS
   Archivo que unifica headers.css y configuracion.css
   ======================================== */

/* ==========================================
   VARIABLES PARA HEADERS
   ========================================== */
:root {
    --header-shadow: rgba(0, 0, 0, 0.2);
    --header-shadow-hover: rgba(0, 0, 0, 0.3);
    --header-overlay: rgba(255, 255, 255, 0.1);
    --header-transition: all 0.3s ease;
}

/* ==========================================
   HEADER PRINCIPAL ADAPTATIVO
   ========================================== */
.header-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

/* Efecto de overlay sutil */
.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--header-overlay);
    pointer-events: none;
}

/* Patrón de textura para configuración */
.header-section.config-header::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

/* Contenido del header */
.header-section .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Layout para header-content y header-actions */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.header-text {
    flex: 1;
}

.header-actions {
    flex-shrink: 0;
    margin-left: auto;
}

/* Layout flexbox para header-section sin contenedor */
.header-section:not(:has(.container)) {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Botones de acción en header */
.header-section .btn-back,
.header-section .btn-primary,
.header-section .btn-secondary {
    margin-left: auto;
    flex-shrink: 0;
}

/* Títulos */
.header-section h1,
.header-section h2 {
    color: white;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 0 2px 4px var(--header-shadow);
    font-size: 2.5rem;
}

.header-section h1 {
    margin-bottom: 15px;
}

/* Subtítulo */
.header-section p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    font-weight: 400;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Botones en el header */
.header-section .btn {
    border-radius: 10px;
    font-weight: 600;
    transition: var(--header-transition);
    box-shadow: 0 4px 15px var(--header-shadow);
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    backdrop-filter: blur(10px);
}

.header-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--header-shadow-hover);
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

/* ==========================================
   ADAPTACIONES ESPECÍFICAS POR PALETA
   ========================================== */
.paleta-energia .header-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, #FF6B6B 50%, var(--color-secondary) 100%);
}

.paleta-profesional .header-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4A5568 50%, var(--color-secondary) 100%);
}

.paleta-moderno .header-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, #10B981 50%, var(--color-secondary) 100%);
}

/* ==========================================
   PESTAÑAS MODERNAS (CONFIGURACIÓN)
   ========================================== */
.nav-tabs-modern {
    background: linear-gradient(135deg, var(--color-light) 0%, #ffffff 100%);
    border-radius: 10px 10px 0 0;
    padding: 10px;
}

.nav-tabs-modern .nav-link {
    border: none;
    border-radius: 8px;
    margin: 0 5px;
    padding: 12px 20px;
    color: var(--color-text) !important;
    font-weight: 500;
    transition: var(--header-transition);
    background: rgba(var(--color-primary-rgb, 26, 75, 122), 0.1) !important;
}

.nav-tabs-modern .nav-link:hover {
    background: rgba(var(--color-primary-rgb, 26, 75, 122), 0.2) !important;
    color: var(--color-primary-dark) !important;
    transform: translateY(-2px);
}

.nav-tabs-modern .nav-link.active {
    background: var(--color-dark) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(var(--color-primary-rgb, 26, 75, 122), 0.3);
}

/* ==========================================
   ESTILOS PARA NAVBAR Y BRAND
   ========================================== */
.navbar-logo {
    height: 40px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
    border-radius: 6px;
    transition: var(--header-transition);
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    text-decoration: none;
    transition: var(--header-transition);
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-weight: 700;
    transition: var(--header-transition);
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.navbar-brand:hover .brand-text {
    color: rgba(255, 255, 255, 0.9);
}

/* Estilos para el toggler del navbar */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    transition: var(--header-transition);
}

.navbar-toggler:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .header-section {
        padding: 20px 0;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 0 1rem;
    }
    
    .header-section h1,
    .header-section h2 {
        font-size: 2rem;
    }
    
    .header-section p {
        font-size: 1rem;
    }
    
    .header-actions {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .header-section {
        padding: 15px 0;
        margin-bottom: 20px;
    }
    
    .header-section h1,
    .header-section h2 {
        font-size: 1.5rem;
    }
    
    .header-section p {
        font-size: 0.9rem;
    }
    
    .header-section .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .nav-tabs-modern .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}