/* ================================
   Reset básico y configuración general
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================================
   Estilos base
   ================================ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #092039 0%, #092039 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    position: relative;
}

.success-alert {
    background: rgba(46, 204, 113, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ================================
   Contenedor principal
   ================================ */
.container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.8s ease-out;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #092039, #092039, #092039);
    border-radius: 20px 20px 0 0;
}

/* ================================
   Títulos
   ================================ */
h1 {
    position: relative;
    margin-bottom: 40px;
    padding-bottom: 15px;
    text-align: center;
    color: #2c3e50;
    font-size: 2.8rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-45%);
    width: 850px;
    height: 4px;
    background: linear-gradient(90deg, #5e7bff, #092039);  /* ================================*/
    border-radius:12px;
}

/* ================================
   Formulario de búsqueda
   ================================ */
.search-form {
    position: relative;
    margin-bottom: 30px;
    padding: 35px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(94, 123, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.search-form:hover {
    transform: translateY(-3px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.search-form:hover::before {
    left: 100%;
}

.search-form .form-group {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Campo de entrada */
.search-form input[type="text"] {
    flex: 1;
    min-width: 300px;
    padding: 18px 25px;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-form input[type="text"]::placeholder {
    color: #9ca3af;
    font-weight: 400;
    transition: all 0.3s ease;
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: #5e7bff;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(94, 123, 255, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 8px 25px rgba(94, 123, 255, 0.1);
    transform: translateY(-2px);
}

.search-form input[type="text"]:focus::placeholder {
    color: transparent;
}

/* Botón de búsqueda */
.search-form button {
    position: relative;
    min-width: 150px;
    padding: 18px 35px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    background: linear-gradient(135deg,  #274a6e 0%, #092039 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(94, 123, 255, 0.3);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.search-form button::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
}

.search-form button:hover {
    transform: translateY(-3px);
    padding-right: 45px;
    box-shadow: 0 12px 35px rgba(94, 123, 255, 0.4);
}

.search-form button:hover::before {
    left: 100%;
}

.search-form button:hover::after {
    opacity: 1;
}

.search-form button:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(94, 123, 255, 0.3);
}

/* ================================
   Mensajes de error y sin resultados
   ================================ */
.error {
    position: relative;
    margin: 25px 0;
    padding: 20px 25px 20px 55px;
    font-weight: 500;
    color: #c33;
    background: linear-gradient(135deg, #fee, #fdd);
    border: 2px solid #fcc;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(204, 51, 51, 0.1);
    animation: shake 0.5s ease-in-out;
}

.error::before {
    content: '⚠️';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.no-results {
    position: relative;
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #6b7280;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    animation: fadeIn 0.6s ease-out;
}

.no-results::before {
    content: '🔍';
    display: block;
    margin-bottom: 15px;
    font-size: 48px;
    opacity: 0.7;
}

/* ================================
   Tablas de licencias
   ================================ */
.table-container {
    margin-top: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s ease-out;
}

.licencias-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.licencias-table thead {
    position: relative;
    background: linear-gradient(135deg, #699bce 0%, #092039 100%);
    color: #fff;
}

.licencias-table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.licencias-table th {
    padding: 20px 15px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.licencias-table td {
    padding: 15px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.licencias-table tbody tr {
    position: relative;
    border-bottom: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.licencias-table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.licencias-table tbody tr:last-child {
    border-bottom: none;
}

.licencias-table tbody tr:hover {
    background-color: rgba(94, 123, 255, 0.05);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ================================
   Botones de eventos
   ================================ */
.eventos,
.close-eventos {
    display: inline-block;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.eventos {
    background: linear-gradient(135deg, #274a6e, #092039);
    box-shadow: 0 6px 20px rgba(39, 74, 110, 0.3);
}

.close-eventos {
    background: linear-gradient(135deg, #dc3545, #c82333);
    margin-top: 20px;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.eventos::before,
.close-eventos::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.eventos:hover,
.close-eventos:hover {
    transform: translateY(-3px);
    text-decoration: none;
}

.eventos:hover {
    box-shadow: 0 8px 25px rgba(167, 40, 40, 0.4);
}

.close-eventos:hover {
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.eventos:hover::before,
.close-eventos:hover::before {
    left: 100%;
}

.eventos:active,
.close-eventos:active {
    transform: translateY(-1px);
}

/* Contenedor y tabla de detalles de eventos */
.eventos-detail {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-top: 3px solid #5e7bff;
}

.eventos-detail td {
    padding: 0 !important;
}

.eventos-container {
    margin: 15px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.4s ease-out;
}

.eventos-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.eventos-table thead {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
}

.eventos-table th {
    padding: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.eventos-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

.eventos-table tbody tr {
    border-bottom: 1px solid #e1e8ed;
    transition: background-color 0.2s ease;
}

.eventos-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.eventos-table tbody tr:hover {
    background-color: #f1f3f4;
}

.eventos-table tbody tr:last-child {
    border-bottom: none;
}

/* ================================
   Panel de detalles
   ================================ */
.detail-panel {
    display: flex;
    gap: 25px;
    margin-top: 25px;
}

.panel-side {
    flex: 1;
    padding: 20px;
    background: linear-gradient(145deg, #fff, #f8f9fa);
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.panel-side:hover {
    transform: translateY(-2px);
}

.panel-side h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #2c3e50;
    border-bottom: 2px solid #092039;
    padding-bottom: 10px;
}

/* ================================
   Loading spinner
   ================================ */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border: 3px solid rgba(94, 123, 255, 0.3);
    border-top: 3px solid #092039;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
/* 1. Navegación principal con diseño mejorado */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Mejor distribución del espacio */
  padding: 1rem 5rem;
  /* background: linear-gradient(135deg, #092039, #162b43); */
  background: rgba(9, 32, 57, 0.25);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0%);
}

/* 2. Enlaces del nav con mejor espaciado */
.main-nav a {
  color: #fff;
  text-decoration: none;
  margin-right: 1rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  transition: color 0.3s ease;
}

.main-nav a:hover {
  color: #64b5f6;
}

/* 3. Botón de cierre de sesión mejorado */
.btn-logout {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 20px;
  background: rgba(255, 25, 0, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 25, 0, 0.25);
  border-radius: 5px;
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 25, 0, 0.25);
  position: relative;
  overflow: hidden;
}

/* Efecto hover mejorado */
.btn-logout:hover {
  background: rgba(255, 25, 0, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 25, 0, 0.5);
}

/* Efecto de click */
.btn-logout:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 25, 0, 0.5);
}

/* Efecto de brillo sutil */
.btn-logout::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-logout:hover::before {
  left: 100%;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.user-info svg {
  color: #699bce;
  flex-shrink: 0;
}

.username {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-nav {
    padding: 1rem;
    flex-wrap: wrap;
  }
  
  .btn-logout {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }
}

/* ================================
   Animaciones
   ================================ */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 25px;
        border-radius: 16px;
    }
    h1 { font-size: 2.2rem; margin-bottom: 30px; }
    .search-form {
        padding: 25px;
    }
    .search-form .form-group {
        flex-direction: column;
        gap: 15px;
    }
    .search-form input[type="text"] { min-width: 100%; }
    .search-form button {
        width: 100%;
        padding: 18px;
    }
    .licencias-table { font-size: 14px; }
    .licencias-table th,
    .licencias-table td {
        padding: 12px 8px;
    }
    .licencias-table td:last-child {
        text-align: center;
    }
    .eventos-container {
        margin: 10px;
        padding: 20px;
    }
    .detail-panel {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        padding: 20px;
    }
    h1 { font-size: 1.8rem; }
    .search-form { padding: 20px; }
    .licencias-table th,
    .licencias-table td {
        padding: 10px 6px;
        font-size: 12px;
    }
    .eventos,
    .close-eventos {
        padding: 8px 16px;
        font-size: 11px;
    }
    .licencias-table td:last-child {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .licencias-table td a {
        display: inline-block;
        padding: 6px 12px;
    }
}
