/*
 * iber-colaboradores CSS
 * Sistema de Diseño: Iberdrola Colaboradores
 */

/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    --iber-bg-global: #fcfbfa;
    --iber-bg-card: #fff5ec;
    --iber-text-main: #333333;
    --iber-text-muted: #666666;
    --iber-border-color: #e5d8cd;

    /* Botones y Acciones */
    --iber-green-bright: #00A443;
    --iber-green-dark: #00402A;
    --iber-blue: #0DA9FF;
    --iber-orange: #FF9C1A;
    --iber-red: #D32F2F;
    --iber-gray-dark: #424242;
    
    /* Sombras y Transiciones */
    --iber-shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
    --iber-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --iber-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --iber-border-radius: 12px;
}

:root[data-theme="dark"] {
    --iber-bg-global: #121212;
    --iber-bg-card: #1e1e1e;
    --iber-text-main: #e0e0e0;
    --iber-text-muted: #aaaaaa;
    --iber-border-color: #333333;
    --iber-shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.5);
    --iber-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.8);
}

/* Solo aplicamos al contenedor principal del plugin para no pisar WP si se carga en otro lado */
.iber-login-body,
.iber-panel-body {
    background-color: var(--iber-bg-global);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--iber-text-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   2. ANIMACIONES
   ========================================================================== */
@keyframes iberFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.iber-animate-fade-in {
    animation: iberFadeInUp 0.6s ease-out forwards;
}

/* ==========================================================================
   3. TIPOGRAFÍA Y UTILIDADES
   ========================================================================== */
.iber-h1, .iber-h2, .iber-h3, h1, h2, h3 {
    color: var(--iber-green-dark);
    font-weight: 700;
    margin-top: 0;
}

/* ==========================================================================
   4. SISTEMA DE BOTONES (Requisitos Obligatorios)
   ========================================================================== */
.iber-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--iber-border-radius);
    border: none;
    cursor: pointer;
    transition: var(--iber-transition);
    text-decoration: none;
    box-shadow: var(--iber-shadow-soft);
    font-family: 'Inter', sans-serif;
}

.iber-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--iber-shadow-hover);
}

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

.iber-btn-block {
    width: 100%;
}

/* Primario: Guardar, Solicitar, Hecho, Siguiente, OK */
.iber-btn-primary {
    background: linear-gradient(135deg, var(--iber-green-bright) 0%, var(--iber-green-dark) 100%);
    color: #ffffff;
}
.iber-btn-primary:hover {
    background: linear-gradient(135deg, #00b54a 0%, #005236 100%);
    color: #ffffff;
}

/* Secundario: Ver más, Abrir, Desplegables (Efecto sutil) */
.iber-btn-secondary {
    background: linear-gradient(135deg, rgba(13, 169, 255, 0.9) 0%, rgba(13, 169, 255, 1) 100%);
    color: #ffffff;
    /* Efecto Glassmorphism sutil opcional si se usa con fondos */
    backdrop-filter: blur(4px);
}
.iber-btn-secondary:hover {
    background: linear-gradient(135deg, rgba(30, 180, 255, 1) 0%, rgba(13, 169, 255, 1) 100%);
    color: #ffffff;
}

/* Editar / Alertas */
.iber-btn-warning {
    background-color: var(--iber-orange);
    color: #ffffff;
}

/* Eliminar */
.iber-btn-danger {
    background: linear-gradient(135deg, var(--iber-red) 0%, var(--iber-gray-dark) 100%);
    color: #ffffff;
}

/* Volver / Ghost */
.iber-btn-ghost {
    background: transparent;
    border: 2px solid var(--iber-green-dark);
    color: var(--iber-green-dark);
    box-shadow: none;
}
.iber-btn-ghost:hover {
    background-color: rgba(0, 64, 42, 0.05);
    color: var(--iber-green-dark);
    box-shadow: none;
}

/* ==========================================================================
   5. FORMULARIOS Y TARJETAS
   ========================================================================== */
.iber-card {
    background-color: var(--iber-bg-card);
    border-radius: var(--iber-border-radius);
    padding: 32px;
    box-shadow: var(--iber-shadow-soft);
    border: 1px solid var(--iber-border-color);
}

.iber-form-group {
    margin-bottom: 24px;
}

.iber-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--iber-green-dark);
    font-size: 0.95rem;
}

.iber-form-group input[type="text"],
.iber-form-group input[type="email"],
.iber-form-group input[type="password"],
.iber-form-group input[type="number"],
.iber-form-group select,
.iber-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--iber-border-color);
    background-color: var(--iber-bg-global);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--iber-text-main);
    transition: var(--iber-transition);
    box-sizing: border-box;
}

.iber-form-group input:focus,
.iber-form-group select:focus,
.iber-form-group textarea:focus {
    outline: none;
    border-color: var(--iber-green-bright);
    box-shadow: 0 0 0 3px rgba(0, 164, 67, 0.15);
}

/* ==========================================================================
   6. PÁGINA DE LOGIN (Construida en el Paso 2)
   ========================================================================== */
.iber-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at top right, rgba(0,164,67,0.05), transparent 400px), var(--iber-bg-global);
}

.iber-login-card {
    background-color: var(--iber-bg-card);
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0 10px 40px rgba(0, 64, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: iberFadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.iber-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.iber-logo-placeholder {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 164, 67, 0.1);
}

.iber-login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.iber-login-header p {
    color: var(--iber-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.iber-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.iber-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--iber-text-muted);
}

.iber-checkbox input {
    margin-right: 8px;
    accent-color: var(--iber-green-bright);
    width: 16px;
    height: 16px;
}

.iber-forgot-link {
    color: var(--iber-blue);
    text-decoration: none;
    font-weight: 500;
    transition: var(--iber-transition);
}

.iber-forgot-link:hover {
    color: var(--iber-green-dark);
}

/* ==========================================================================
   7. ALERTAS Y MENSAJES
   ========================================================================== */
.iber-alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
}

.iber-alert-error {
    background-color: rgba(211, 47, 47, 0.1);
    color: var(--iber-red);
    border: 1px solid rgba(211, 47, 47, 0.2);
}

.iber-alert-success {
    background-color: rgba(0, 164, 67, 0.1);
    color: var(--iber-green-dark);
    border: 1px solid rgba(0, 164, 67, 0.2);
}

/* ==========================================================================
   8. LAYOUT PANEL PRINCIPAL (Preparación Paso 4 y 5)
   ========================================================================== */
.iber-layout {
    display: flex;
    min-height: 100vh;
}

.iber-sidebar-wrapper {
    position: relative;
    display: flex;
    z-index: 100;
}

.iber-sidebar {
    width: 260px;
    background-color: var(--iber-green-dark);
    border-right: 1px solid var(--iber-border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: var(--iber-transition);
    overflow: hidden;
}

.iber-sidebar.collapsed {
    width: 80px;
    padding: 24px 12px;
}

.iber-sidebar.collapsed .iber-logo-placeholder img,
.iber-sidebar.collapsed .iber-logo-placeholder svg {
    max-width: 40px;
}

.iber-sidebar.collapsed .iber-nav-btn span,
.iber-sidebar.collapsed .iber-nav-text {
    display: none;
}

.iber-sidebar.collapsed .iber-nav-btn svg {
    margin-right: 0;
}

.iber-sidebar .iber-nav-btn {
    color: #ffffff;
    border-color: transparent;
    justify-content: flex-start;
    padding: 12px 16px;
    gap: 12px;
}
.iber-sidebar .iber-nav-btn svg {
    stroke: #ffffff;
    flex-shrink: 0;
}
.iber-sidebar .iber-nav-btn:hover,
.iber-sidebar .iber-nav-btn.active {
    background-color: rgba(255,255,255,0.1);
    border-color: transparent;
}
.iber-sidebar .iber-btn-danger {
    margin-top: auto;
}

/* Multi-step form styles */
.iber-step {
    display: none;
    animation: iberFadeInUp 0.4s ease-out forwards;
}
.iber-step.active {
    display: block;
}
.iber-step-header {
    background: var(--iber-bg-global);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid var(--iber-green-bright);
}
.iber-step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--iber-border-color);
}

.iber-main-content {
    flex: 1;
    padding: 40px;
    width: 100%;
    /* Removido max-width y margin:0 auto para que ocupe todo el espacio sobrante fluidamente */
}

/* Lengüetas del Sidebar */
.iber-tabs-container {
    position: absolute;
    right: -40px; /* Sobresale hacia la derecha exacto el ancho del botón */
    bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.iber-tab {
    width: 40px;
    height: 48px;
    background-color: var(--iber-green-dark);
    color: #ffffff;
    border: 1px solid var(--iber-border-color);
    border-left: none;
    border-radius: 0 12px 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.1);
    transition: var(--iber-transition);
    padding: 0;
}
.iber-tab:hover {
    background-color: var(--iber-green-bright);
    width: 44px; /* Pequeño efecto hover */
    right: -44px;
}
.iber-tab svg {
    stroke: #ffffff;
    width: 20px;
    height: 20px;
}

.iber-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.iber-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
