/* Modern "Soft 3D" Neumorphic Theme */

/* Reset y configuración base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #ebeff9; /* Set base background color */
}

/* Variables para el tema Neumórfico */
:root {
    --header-height: 85px;
    --sidebar-width: 300px;
    
    /* Neumorphism Colors */
    --nm-bg: #ebeff9;
    --nm-text: #2C3E50;
    --nm-accent: #3498DB;
    --nm-shadow-light: #ffffff;
    --nm-shadow-dark: #d1d9e6;
    --nm-shadow-main: -6px -6px 12px var(--nm-shadow-light), 6px 6px 12px var(--nm-shadow-dark);
    --nm-shadow-inset: inset -4px -4px 8px var(--nm-shadow-light), inset 4px 4px 8px var(--nm-shadow-dark);
}

/* Header Principal "Soft 3D" */
.header-glass {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--nm-bg);
    z-index: 1000;
    transition: all 0.4s ease;
}

@media (min-width: 1200px) {
    .header-glass {
        display: none;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 2.5rem;
}

/* Logo y Brand */
.header-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: all 0.4s ease;
    border-radius: 8px;
}

.header-brand:hover .header-logo {
    transform: scale(1.05);
}

/* Botón Sidebar Toggle (Neumorphic) */
.sidebar-toggle {
    background: var(--nm-bg);
    border: none;
    border-radius: 15px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nm-text);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: var(--nm-shadow-main);
}

.sidebar-toggle:hover {
    color: var(--nm-accent);
}

.sidebar-toggle:active {
    box-shadow: var(--nm-shadow-inset);
    color: var(--nm-accent);
}

.sidebar-toggle i {
    font-size: 1.5rem;
    transition: transform 0.4s ease;
}

.sidebar-toggle.active i {
    transform: rotate(180deg);
}

/* Header Actions (Neumorphic) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--nm-text);
    background: var(--nm-bg);
    padding: 0.7rem 1.4rem;
    border-radius: 25px;
    text-decoration: none;
    box-shadow: var(--nm-shadow-main);
    transition: all 0.2s ease-in-out;
}

.header-user:hover {
    box-shadow: var(--nm-shadow-inset);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--nm-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.header-user:hover .user-avatar {
    transform: scale(1.05);
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Sidebar "Soft 3D" */
.sidebar-3d {
    position: fixed;
    top: var(--header-height); /* Default for mobile */
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height)); /* Default for mobile */
    background: var(--nm-bg);
    border-right: 1px solid var(--nm-shadow-dark);
    transform: translateX(-100%);
    transition: all 0.4s ease;
    z-index: 999;
    padding-top: 1rem;
}

.sidebar-3d.active {
    transform: translateX(0);
}

/* Sidebar fijo en desktop */
@media (min-width: 1200px) {
    .sidebar-3d {
        transform: translateX(0);
        position: fixed;
        top: 0; /* Override for desktop */
        height: 100vh; /* Override for desktop */
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 2rem;
        transition: margin-left 0.4s ease;
        margin-top: 0; /* Override for desktop */
    }

    /* Adjust header content to align with main content area */
    .header-content {
        padding-left: calc(var(--sidebar-width) + 2rem);
    }
}

/* Sidebar Content */
.sidebar-content {
    height: 100%;
    overflow-y: auto;
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 1rem 1.5rem 1.5rem;
    margin-bottom: 1rem;
}

.sidebar-logo-container {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.sidebar-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
}

.sidebar-logo-text {
    flex: 1;
}

.sidebar-logo-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--nm-text);
}

.sidebar-logo-subtitle {
    font-size: 0.75rem;
    color: #5a6a7a;
    line-height: 1.2;
    font-weight: 600;
}

.sidebar-content::-webkit-scrollbar {
    width: 5px;
}
.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--nm-shadow-dark);
    border-radius: 5px;
}

/* Sidebar Navigation (Neumorphic) */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 0.8rem 1.5rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.5rem;
    color: var(--nm-text);
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.2s ease-in-out;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--nm-shadow-main);
}

.sidebar-nav-link:hover {
    color: var(--nm-accent);
}

.sidebar-nav-link.active,
.sidebar-nav-link:active {
    box-shadow: var(--nm-shadow-inset);
    color: var(--nm-accent);
}

.sidebar-nav-link i {
    margin-right: 1.2rem;
    font-size: 1.3rem;
    width: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

/* Sidebar Footer (Neumorphic) */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem;
}

.sidebar-footer-btn {
    width: 100%;
    background: var(--nm-bg);
    border: none;
    color: #c0392b; /* Logout red */
    padding: 1rem;
    border-radius: 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.2s ease-in-out;
    font-weight: 600;
    box-shadow: var(--nm-shadow-main);
}

.sidebar-footer-btn:hover {
    color: #e74c3c;
}

.sidebar-footer-btn:active {
    box-shadow: var(--nm-shadow-inset);
    color: #e74c3c;
}

.sidebar-footer-btn i {
    font-size: 1.1rem;
}

/* Overlay para cerrar sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 998;
    display: none;
}

/* Solo mostrar overlay en móvil */
@media (max-width: 1199px) {
    .sidebar-overlay {
        display: block;
    }
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content Adjustment */
.main-content {
    margin-top: var(--header-height); /* Default for mobile */
    transition: all 0.4s ease;
    min-height: calc(100vh - var(--header-height));
    position: relative;
    z-index: 1;
    width: 100%;
}

@media (min-width: 1200px) {
    .main-content {
        margin-top: 0;
    }
}

/* Footer Sencillo */
.footer-simple {
    background: var(--nm-bg);
    color: var(--nm-text);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--nm-shadow-dark);
}

.footer-simple .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--nm-text);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-logo {
    height: 35px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.footer-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: var(--nm-text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.footer-links a:hover {
    color: var(--nm-accent);
}

.footer-copyright {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--nm-shadow-dark);
    color: #5a6a7a;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }

    .sidebar-3d {
        width: 280px; /* Adjust for mobile */
    }

    .main-content {
        padding: 1rem;
    }
    .main-content.active-sidebar {
      margin-left: 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}
