/* ========================================================
   PLATAFORMA DE GESTIÓN DE EMPLEO Y POSTULACIONES
   Estilo General y Base del Sistema (estilo.css)
   ======================================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --estudiante: #2563eb;
    --reclutador: #0d9488;
    --admin: #7c3aed;

    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --neutral: #64748b;
    --neutral-bg: #f1f5f9;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
    object-fit: cover;
}

/* Layout General del Panel */
.panel-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Superior */
.panel-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.brand-logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.brand-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-estudiante { background: #dbeafe; color: #1e40af; }
.badge-reclutador { background: #ccfbf1; color: #115e59; }
.badge-admin { background: #ede9fe; color: #5b21b6; }

.header-user-section {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-badge-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--neutral-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
}

.user-meta {
    line-height: 1.2;
}

.user-meta .user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.user-meta .user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    font-size: 0.88rem;
    border: 1px solid #fecaca;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #fecaca;
    color: #991b1b;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 6px;
}

/* Cuerpo con Sidebar y Contenido Central */
.panel-body {
    display: flex;
    flex: 1;
}

/* Sidebar Lateral */
.panel-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-menu-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 14px 12px 6px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: #475569;
    font-weight: 500;
    font-size: 0.93rem;
    transition: var(--transition);
}

.sidebar-menu a i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-menu a:hover {
    background: var(--neutral-bg);
    color: var(--text-dark);
}

.sidebar-menu a.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Temas por Rol */
.theme-reclutador .sidebar-menu a.active {
    background: var(--reclutador);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}
.theme-admin .sidebar-menu a.active {
    background: var(--admin);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.sidebar-footer-info {
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Área Central de Contenido */
.panel-main {
    flex: 1;
    padding: 30px;
    background: var(--bg-main);
    overflow-y: auto;
}

.content-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.content-header h1 {
    font-size: 1.65rem;
    color: var(--text-dark);
    font-weight: 700;
}

.content-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Pie de Página */
.panel-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 18px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* Alertas Flash */
.alert-flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.3s ease-out;
}

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

.alert-flash-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-flash-content i {
    font-size: 1.25rem;
}

.btn-close-alert {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
    transition: var(--transition);
}

.btn-close-alert:hover {
    opacity: 1;
}

.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-bg); color: #075985; border: 1px solid #bae6fd; }

/* Botones Comunes */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-reclutador { background: var(--reclutador); color: #ffffff; }
.btn-reclutador:hover { background: #0f766e; }

.btn-admin { background: var(--admin); color: #ffffff; }
.btn-admin:hover { background: #6d28d9; }

.btn-secondary { background: #ffffff; color: #475569; border-color: #cbd5e1; }
.btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }

.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* Tarjetas y Contenedores */
.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Estados de Postulaciones (Con los colores solicitados exactamente) */
/* verde=aceptada, amarillo=en revisión, azul=entrevista, gris=pendiente, rojo=rechazada */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-pendiente {
    background: #f1f5f9;
    color: #475569;
}
.status-pendiente::before { background: #64748b; }

.status-en-revision, .status-en_revision {
    background: #fef3c7;
    color: #b45309;
}
.status-en-revision::before, .status-en_revision::before { background: #f59e0b; }

.status-entrevista-programada, .status-entrevista_programada {
    background: #e0f2fe;
    color: #0369a1;
}
.status-entrevista-programada::before, .status-entrevista_programada::before { background: #0284c7; }

.status-aceptada {
    background: #d1fae5;
    color: #065f46;
}
.status-aceptada::before { background: #10b981; }

.status-rechazada {
    background: #fee2e2;
    color: #991b1b;
}
.status-rechazada::before { background: #ef4444; }

/* Grid de Formularios */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-size: 0.92rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
    .panel-sidebar {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        bottom: 0;
        z-index: 99;
        box-shadow: var(--shadow-lg);
    }
    
    .panel-sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .panel-main {
        padding: 20px 16px;
    }
}
