/* Admin Panel Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* Logo con sombra */
.logo-with-shadow {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(120, 119, 198, 0.6));
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    opacity: 0.9;
}

.logo-with-shadow:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(255, 119, 198, 0.8));
    transform: scale(1.05);
    opacity: 1;
}

.sidebar .logo-container {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    margin: 8px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar .logo-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(120, 119, 198, 0.1) 0%,
        rgba(255, 119, 198, 0.05) 50%,
        rgba(120, 219, 255, 0.08) 100%);
    border-radius: 16px;
    z-index: 1;
}

.sidebar .logo-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: rotate-logo 20s linear infinite;
    z-index: 1;
}

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

/* Partículas flotantes del sidebar */
.sidebar-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.sidebar-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(120, 119, 198, 0.6);
    border-radius: 50%;
    animation: float-sidebar-particle 12s infinite linear;
}

.sidebar-particle:nth-child(2n) {
    background: rgba(255, 119, 198, 0.4);
    animation-duration: 15s;
}

.sidebar-particle:nth-child(3n) {
    background: rgba(120, 219, 255, 0.5);
    animation-duration: 18s;
}

@keyframes float-sidebar-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    z-index: 100;
    padding: 20px 0 0;
    background: #0f1419;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(120, 119, 198, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(120, 219, 255, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, rgba(15, 20, 25, 0.95) 0%, rgba(25, 35, 45, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        25px 0 50px rgba(0, 0, 0, 0.3),
        inset -1px 0 0 rgba(255, 255, 255, 0.05);
    overflow: visible !important;
    height: 100vh;
    min-height: 100vh;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(120, 119, 198, 0.02) 2px,
            rgba(120, 119, 198, 0.02) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 2px,
            rgba(255, 119, 198, 0.015) 2px,
            rgba(255, 119, 198, 0.015) 4px
        );
    pointer-events: none;
    z-index: 1;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 20%, rgba(120, 119, 198, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.06) 0%, transparent 25%),
        radial-gradient(circle at 60% 40%, rgba(120, 219, 255, 0.04) 0%, transparent 25%);
    animation: float-sidebar 25s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes float-sidebar {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 4px 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(120, 119, 198, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.sidebar .nav-link:hover::before {
    left: 100%;
}

.sidebar .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(120, 119, 198, 0.3) 0%, rgba(255, 119, 198, 0.2) 100%);
    border: 1px solid rgba(120, 119, 198, 0.4);
    font-weight: 600;
    box-shadow:
        0 8px 16px rgba(120, 119, 198, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(120, 119, 198, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(120, 119, 198, 0.15);
}

.sidebar .nav-link.active:hover {
    color: #ffffff;
    transform: translateX(4px);
    box-shadow:
        0 12px 24px rgba(120, 119, 198, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
}

/* Estilos para el dropdown del usuario */
.sidebar .dropdown-toggle {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.sidebar .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(120, 119, 198, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(120, 119, 198, 0.15);
}

.sidebar .dropdown-toggle::after {
    border-top-color: rgba(255, 255, 255, 0.8);
}

/* Líneas divisorias del sidebar */
.sidebar hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 16px 8px;
    opacity: 0.3;
}

/* Avatar del usuario */
.sidebar .dropdown-toggle .rounded-circle {
    background: linear-gradient(135deg, rgba(120, 119, 198, 0.3) 0%, rgba(255, 119, 198, 0.2) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

/* Dropdown del usuario - Posicionamiento correcto */
.sidebar .dropdown {
    position: relative !important;
    overflow: visible !important;
}

.sidebar .dropdown-menu,
.sidebar .dropdown-menu-dark,
.sidebar .dropdown-menu.dropdown-menu-dark {
    position: absolute !important;
    top: 0 !important;
    left: calc(100% + 10px) !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    min-width: 220px !important;
    max-width: 300px !important;
    z-index: 9999 !important;
    background: rgba(15, 20, 25, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
    display: none;
}

.sidebar .dropdown-menu.show,
.sidebar .dropdown-menu-dark.show {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: calc(100% + 10px) !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

.sidebar .dropdown-menu .dropdown-item,
.sidebar .dropdown-menu-dark .dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 8px !important;
    margin: 4px 8px !important;
    transition: all 0.3s ease !important;
    padding: 10px 12px !important;
    background: transparent !important;
}

.sidebar .dropdown-menu .dropdown-item:hover,
.sidebar .dropdown-menu-dark .dropdown-item:hover {
    background: rgba(120, 119, 198, 0.2) !important;
    color: #ffffff !important;
    transform: translateX(4px) !important;
}

.sidebar .dropdown-menu .dropdown-divider,
.sidebar .dropdown-menu-dark .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
    margin: 8px 16px !important;
}

/* Main content */
.main-content {
    margin-left: 250px;
    padding: 0;
    min-height: calc(100vh - 60px); /* Altura mínima para dejar espacio para el footer */
    display: flex;
    flex-direction: column;
    overflow-x: visible;
    position: relative;
    z-index: 1;
}

/* Asegurar que el sidebar permita overflow visible para el dropdown */
.sidebar {
    overflow: visible !important;
}

/* Contenedor principal para permitir que el dropdown se vea */
body {
    overflow-x: visible !important;
}

/* Asegurar que el dropdown aparezca encima de todo */
.sidebar .dropdown-menu,
.sidebar .dropdown-menu-dark {
    z-index: 9999 !important;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(70, 130, 180, 0.2);
}

.card-header {
    background-color: #1a3a52; /* Azul marino oscuro */
    color: white;
    border-bottom: 1px solid rgba(0, 0, 0, .125);
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
}

.card-header.bg-light {
    background-color: #f0f8ff !important; /* Azul muy claro */
    color: #36648b; /* Azul acero oscuro */
    border-bottom: 1px solid rgba(70, 130, 180, 0.2);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, .075);
}

/* Buttons */
.btn-primary {
    background-color: #1a3a52; /* Azul marino oscuro */
    border-color: #1a3a52;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #2c5a7c; /* Azul marino un poco más claro */
    border-color: #2c5a7c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 58, 82, 0.3);
}

.btn-success {
    background-color: #3cb371; /* Verde medio mar (mediumseagreen) */
    border-color: #3cb371;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background-color: #2e8b57; /* Verde mar (seagreen) */
    border-color: #2e8b57;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(60, 179, 113, 0.3);
}

.btn-danger {
    background-color: #db7093; /* Rosa pálido (palevioletred) */
    border-color: #db7093;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #c71585; /* Magenta medio (mediumvioletred) */
    border-color: #c71585;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(219, 112, 147, 0.3);
}

/* Forms */
.form-control:focus {
    border-color: #1a3a52; /* Azul marino oscuro */
    box-shadow: 0 0 0 0.2rem rgba(26, 58, 82, 0.25);
}

.form-label {
    font-weight: 600;
    color: #1a3a52; /* Azul marino oscuro */
}

/* Estilos para select y opciones */
select.form-select option:checked,
select.form-select option:selected {
    font-weight: bold;
    color: #1a3a52; /* Azul marino oscuro */
    background-color: rgba(26, 58, 82, 0.1);
}

select.form-select option.fw-bold {
    font-weight: bold !important;
    color: #1a3a52; /* Azul marino oscuro */
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #1a3a52; /* Azul marino oscuro */
}

.page-item.active .page-link {
    background-color: #1a3a52; /* Azul marino oscuro */
    border-color: #1a3a52;
}

/* Alerts */
.alert {
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 0;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Custom colors */
.bg-egg {
    background-color: #f5f5dc;
}

.text-egg {
    color: #f5f5dc;
}

/* QR Code */
.qr-container {
    text-align: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
}

.qr-container img {
    max-width: 200px;
    margin-bottom: 15px;
}

/* Profile */
.profile-header {
    background-color: #007bff;
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
}

.profile-info {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
}

/* Activity log */
.activity-item {
    padding: 15px;
    border-left: 4px solid #1a3a52;
    background-color: #fff;
    margin-bottom: 10px;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 58, 82, 0.2);
}

.activity-item .time {
    color: #6c757d;
    font-size: 0.85rem;
}

.activity-item .action {
    font-weight: 600;
}

.activity-item .description {
    margin-top: 5px;
}

/* Estilos para la tabla de actividades */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(26, 58, 82, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(26, 58, 82, 0.1);
}

/* Estilos para los badges de acción */
.badge.bg-success {
    background-color: #3cb371 !important;
}

.badge.bg-warning {
    background-color: #f0ad4e !important;
}

.badge.bg-danger {
    background-color: #db7093 !important;
}

.badge.bg-info {
    background-color: #5bc0de !important;
}

.badge.bg-primary {
    background-color: #1a3a52 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

/* Stats */
.stats-card {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid #1a3a52; /* Borde superior azul marino oscuro */
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(26, 58, 82, 0.2);
}

.stats-card .title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a3a52; /* Azul marino oscuro */
}

.stats-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a3a52; /* Azul marino oscuro */
}

.stats-card .icon {
    font-size: 3rem;
    color: rgba(26, 58, 82, 0.2); /* Azul marino oscuro semi-transparente */
}

/* Variantes de colores para las tarjetas de estadísticas */
.stats-card.stats-primary {
    border-top-color: #1a3a52; /* Azul marino oscuro */
}
.stats-card.stats-primary .value {
    color: #1a3a52;
}
.stats-card.stats-primary .icon {
    color: rgba(26, 58, 82, 0.2);
}

.stats-card.stats-secondary {
    border-top-color: #5a7d9a; /* Azul grisáceo */
}
.stats-card.stats-secondary .value {
    color: #5a7d9a;
}
.stats-card.stats-secondary .icon {
    color: rgba(90, 125, 154, 0.2);
}

.stats-card.stats-pink {
    border-top-color: #db7093; /* Rosa pálido */
}
.stats-card.stats-pink .value {
    color: #db7093;
}
.stats-card.stats-pink .icon {
    color: rgba(219, 112, 147, 0.2);
}

.stats-card.stats-gray {
    border-top-color: #6c757d; /* Gris */
}
.stats-card.stats-gray .value {
    color: #6c757d;
}
.stats-card.stats-gray .icon {
    color: rgba(108, 117, 125, 0.2);
}

/* Footer */
.footer {
    width: 100%;
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 15px 0;
    margin-top: auto;
    position: relative; /* Cambiado de fixed a relative */
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Loader */
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

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