/* ==================== VARIABLES Y RESET ==================== */
:root {
    --primary: #00d4ff;
    --secondary: #ff0066;
    --purple: #6a00ff;
    --green: #00ffaa;
    --dark: #000000;
    --dark-light: #0a0a0f;
    --dark-card: #0d0d15;
    --glass: rgba(10, 10, 20, 0.6);
    --glass-border: rgba(0, 212, 255, 0.2);
    --text: #ffffff;    --text-muted: #999;
    --shadow-primary: 0 8px 32px rgba(0, 212, 255, 0.3);
    --shadow-secondary: 0 8px 32px rgba(255, 0, 102, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: #000000;
    color: var(--text);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ==================== LOADER AVANZADO ==================== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #0a0a0f 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid transparent;
    animation: loaderSpin 2s linear infinite;
}

.loader-ring:nth-child(1) {
    width: 200px;
    height: 200px;
    border-top-color: #00d4ff;
    border-right-color: #00d4ff;
}

.loader-ring:nth-child(2) {
    width: 160px;
    height: 160px;
    border-top-color: #a000ff;
    border-left-color: #a000ff;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 120px;
    height: 120px;
    border-top-color: #ff0066;
    border-bottom-color: #ff0066;
    animation-duration: 1s;
}

.loader-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    animation: loaderPulse 2s ease-in-out infinite;
}

.loader-text {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 4px;
    background: linear-gradient(90deg, #00d4ff, #a000ff, #ff0066);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: loaderGradient 3s linear infinite;
    white-space: nowrap;
}

.loader-progress {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00d4ff, #a000ff);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.loader-percentage {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: #00d4ff;
    font-weight: 600;
}

@keyframes loaderSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes loaderPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1); 
        opacity: 0.8; 
    }
}

@keyframes loaderGradient {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ==================== SPLINE 3D ==================== */
spline-viewer, #spline-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ==================== VIÑETA ==================== */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.4) 80%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

/* ==================== CONTENIDO PRINCIPAL ==================== */
.main-content {
    position: relative;
    z-index: 10;
    padding: 0;
    min-height: 100vh;
    transition: opacity 1s ease;
}

/* ==================== HEADER 3D ==================== */
.header-3d {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 60px;
    background: linear-gradient(180deg, rgba(10, 10, 20, 0.9) 0%, rgba(10, 10, 20, 0.7) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    border-bottom: 2px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-3d {
    animation: float 3s ease-in-out infinite;
}

.title-3d {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.title-3d .accent {
    color: var(--secondary);
    -webkit-text-fill-color: var(--secondary);
}

.nav-3d {
    display: flex;
    gap: 20px;
}

.nav-btn-3d {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-btn-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.nav-btn-3d:hover::before {
    left: 100%;
}

.nav-btn-3d:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.nav-btn-3d.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(255, 0, 102, 0.2));
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
}

.nav-btn-3d.logout-btn:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 20px rgba(255, 0, 102, 0.5);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    transition: all 0.3s ease;
}

.nav-btn-3d:hover .nav-icon svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px currentColor);
}

.nav-btn-3d.active .nav-icon svg {
    filter: drop-shadow(0 0 12px currentColor);
}

/* ==================== SECCIONES ==================== */
.section-3d {
    display: none;
    padding: 60px;
    animation: fadeInUp 0.8s ease;
}

.section-3d.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.section-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ==================== FILTROS Y BÚSQUEDA ==================== */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-input-3d {
    flex: 1;
    min-width: 300px;
    padding: 15px 20px 15px 50px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 20px center;
    background-size: 18px 18px;
}

.search-input-3d:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.search-input-3d::placeholder {
    color: var(--text-muted);
}

/* === CALENDARIO PERSONALIZADO PREMIUM === */
.date-picker-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 250px;
}

.date-display {
    flex: 1;
    padding-right: 50px !important;
    cursor: text;
    user-select: text;
}

.hidden-date-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.calendar-icon-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #00d4ff;
    z-index: 10;
}

.calendar-icon-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    transform: scale(1.1);
}

.calendar-icon-btn svg {
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
    transition: all 0.3s ease;
}

.calendar-icon-btn:hover svg {
    filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.9));
}

/* Calendario desplegable personalizado */
.custom-calendar {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: linear-gradient(135deg, rgba(13, 13, 21, 0.98) 0%, rgba(26, 26, 42, 0.98) 100%);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(0, 212, 255, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
}

.calendar-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.calendar-nav-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #00d4ff;
}

.calendar-nav-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    transform: scale(1.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.calendar-weekdays > div {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: rgba(0, 212, 255, 0.6);
    text-align: center;
    padding: 8px 0;
    letter-spacing: 0.5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}

.calendar-day {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    transform: scale(1.05);
}

.calendar-day.other-month {
    color: rgba(255, 255, 255, 0.2);
    cursor: default;
}

.calendar-day.other-month:hover {
    background: transparent;
    border-color: transparent;
    transform: none;
}

.calendar-day.today {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    color: #00d4ff;
    font-weight: 700;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-color: #00d4ff;
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.calendar-footer {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 212, 255, 0.2);
}

.calendar-action-btn {
    flex: 1;
    padding: 10px 16px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid;
}

.calendar-action-btn.clear {
    background: rgba(255, 0, 102, 0.1);
    border-color: rgba(255, 0, 102, 0.3);
    color: #ff0066;
}

.calendar-action-btn.clear:hover {
    background: rgba(255, 0, 102, 0.2);
    border-color: #ff0066;
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.4);
}

.calendar-action-btn.today {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

.calendar-action-btn.today:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}


.filter-btn-3d {
    padding: 15px 25px;
    background: var(--glass);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn-3d:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.filter-btn-3d.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(106, 0, 255, 0.3));
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* ==================== CARDS GRID (USUARIOS) ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.user-card-3d {
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.9) 0%, rgba(20, 20, 35, 0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.user-card-3d::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.user-card-3d:hover::before {
    opacity: 1;
}

.user-card-3d:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 212, 255, 0.3), 
                0 0 40px rgba(106, 0, 255, 0.2);
}

.user-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    object-fit: cover;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    display: block;
}

.user-card-3d:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
}

.user-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    position: relative;
    z-index: 2;
}

.info-row {
    font-size: 14px;
    color: var(--text-muted);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-row strong {
    color: var(--primary);
    font-weight: 600;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.action-btn-3d {
    flex: 1;
    padding: 12px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn-3d:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.action-btn-3d.delete:hover {
    background: rgba(255, 0, 102, 0.2);
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.5);
}

/* ==================== TABLA 3D (INTENTOS) ==================== */
.table-container-3d {
    background: linear-gradient(135deg, var(--glass) 0%, rgba(15, 15, 25, 0.8) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 212, 255, 0.1);
}

.table-3d {
    width: 100%;
    border-collapse: collapse;
}

.table-3d thead {
    background: rgba(0, 212, 255, 0.1);
}

.table-3d th {
    padding: 20px;
    text-align: left;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.table-3d td {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 16px;
    transition: background 0.3s ease;
}

.table-3d tbody tr {
    transition: all 0.3s ease;
}

.table-3d tbody tr:hover {
    background: rgba(0, 212, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.loading-cell {
    text-align: center;
    padding: 60px !important;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    margin-right: 15px;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

.emotion-badge {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status-allowed {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00ff88;
    color: #00ff88;
}

.status-blocked {
    background: rgba(255, 0, 102, 0.2);
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.table-btn {
    padding: 8px 16px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.table-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.table-btn.delete {
    border-color: rgba(255, 0, 102, 0.3);
}

.table-btn.delete:hover {
    background: rgba(255, 0, 102, 0.2);
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.5);
    transform: translateY(-2px);
}

/* ==================== MODAL 3D ==================== */
.modal-3d {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-3d.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content-3d {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: linear-gradient(145deg, 
        rgba(15, 20, 40, 0.95) 0%, 
        rgba(25, 30, 50, 0.98) 50%,
        rgba(15, 20, 40, 0.95) 100%);
    backdrop-filter: blur(30px);
    border: none;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(100, 200, 255, 0.05);
    padding: 20px;
    animation: modalAppear 0.4s ease;
    overflow: hidden;
}

/* Línea horizontal superior decorativa */
.modal-content-3d::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 200px);
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #667eea 20%, 
        #764ba2 50%,
        #667eea 80%,
        transparent 100%);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
    pointer-events: none;
    opacity: 0.7;
}

/* Línea horizontal inferior decorativa */
.modal-content-3d::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 200px);
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #667eea 20%, 
        #764ba2 50%,
        #667eea 80%,
        transparent 100%);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
    pointer-events: none;
    opacity: 0.7;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--secondary);
    border: none;
    color: var(--text);
    font-size: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(255, 0, 102, 0.8);
}

.modal-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 
        0 0 80px rgba(0, 212, 255, 0.5),
        0 0 120px rgba(102, 126, 234, 0.3),
        0 25px 70px rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 1;
}

/* Esquinas decorativas tipo dashboard */
.corner-node {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid #667eea;
    border-radius: 15px;
    opacity: 0.7;
    pointer-events: none;
    z-index: 100;
}

.corner-node::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(102, 126, 234, 0.8),
        0 0 30px rgba(102, 126, 234, 0.4);
    animation: nodeGlow 2s ease-in-out infinite;
}

@keyframes nodeGlow {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 1; }
}

.node-tl { 
    top: 15px; 
    left: 15px;
    border-right: none;
    border-bottom: none;
    border-radius: 15px 0 0 0;
    box-shadow: -5px -5px 20px rgba(102, 126, 234, 0.3);
}

.node-tl::before {
    top: -5px;
    left: -5px;
}

.node-tr { 
    top: 15px; 
    right: 15px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 15px 0 0;
    box-shadow: 5px -5px 20px rgba(102, 126, 234, 0.3);
}

.node-tr::before {
    top: -5px;
    right: -5px;
}

.node-bl { 
    bottom: 15px; 
    left: 15px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 15px;
    box-shadow: -5px 5px 20px rgba(102, 126, 234, 0.3);
}

.node-bl::before {
    bottom: -5px;
    left: -5px;
}

.node-br { 
    bottom: 15px; 
    right: 15px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 15px 0;
    box-shadow: 5px 5px 20px rgba(102, 126, 234, 0.3);
}

.node-br::before {
    bottom: -5px;
    right: -5px;
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== ANÁLISIS DE DATOS ==================== */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.analytics-card {
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.9) 0%, rgba(20, 20, 35, 0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.analytics-card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-card-title svg {
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px currentColor);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-row:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
}

.stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-number.success {
    color: var(--green);
}

.stat-number.danger {
    color: var(--secondary);
}

.emotions-list, .top-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.emotion-item, .user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(20, 20, 40, 0.3) 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.emotion-item::before, .user-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.emotion-item:hover, .user-item:hover {
    background: linear-gradient(135deg, rgba(10, 10, 20, 0.6) 0%, rgba(30, 30, 60, 0.4) 100%);
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.15), 0 0 40px rgba(0, 212, 255, 0.08);
    border-left-color: #00d4ff;
}

.emotion-item:hover::before, .user-item:hover::before {
    opacity: 1;
}

.emotion-name, .user-name-item {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.emotion-name svg, .user-name-item svg {
    filter: drop-shadow(0 0 8px currentColor);
    animation: emotionIconPulse 3s ease-in-out infinite;
}

@keyframes emotionIconPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.15);
        opacity: 0.9;
    }
}

.emotion-count, .user-count {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-weight: 900;
    font-size: 20px;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.1) 100%);
    border-radius: 25px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2), inset 0 0 10px rgba(0, 212, 255, 0.1);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    min-width: 45px;
    text-align: center;
    transition: all 0.3s ease;
}

.emotion-count:hover, .user-count:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), inset 0 0 15px rgba(0, 212, 255, 0.2);
}

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
}

.activity-time {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
    min-width: 150px;
}

.activity-details {
    flex: 1;
}

.activity-user {
    font-weight: 600;
    color: var(--text);
}

.activity-action {
    font-size: 14px;
    color: var(--text-muted);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ==================== ESTILOS DE FORMULARIO EN MODAL ==================== */
#editUserForm input:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3) !important;
}

#editUserForm input:hover {
    border-color: rgba(0, 212, 255, 0.5);
}

#editUserForm label {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================== BOTÓN ACTUALIZAR ==================== */
.filter-btn-3d:disabled {
    cursor: not-allowed;
    opacity: 0.6 !important;
}

.filter-btn-3d svg {
    transition: transform 0.3s ease;
}

.filter-btn-3d:active svg {
    transform: rotate(180deg);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.filter-btn-3d:disabled svg {
    animation: spin 1s linear infinite;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .header-3d {
        padding: 20px 40px;
    }
    
    .section-3d {
        padding: 40px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-3d {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-3d {
        width: 100%;
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container-3d {
        overflow-x: scroll;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }
}
