/* ============================================
   EMEDOS LAYOUT CSS - SIDEBAR & TOPBAR
   Estilos para el layout con Tailwind CSS
   ============================================ */

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar-wrapper {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, #1e2139 0%, #181a2e 100%);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(115, 86, 241, 0.15) 0%, rgba(155, 89, 182, 0.1) 100%);
    color: #fff;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #7356f1 0%, #9b59b6 100%);
    border-radius: 0 2px 2px 0;
}

/* ========================================
   SIDEBAR OVERLAY (MOBILE)
   ======================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

/* ========================================
   PAGE WRAPPER
   ======================================== */
.page-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f5f7fa;
}

/* ========================================
   TOP HEADER
   ======================================== */
.top-header {
    height: 70px;
    z-index: 999;
}

/* ========================================
   DESKTOP - SIDEBAR MINI (TOGGLED)
   ======================================== */
@media (min-width: 1024px) {
    /* Sidebar mini */
    #main-wrapper.toggled .sidebar-wrapper {
        width: 70px;
    }

    #main-wrapper.toggled .page-wrapper {
        margin-left: 70px;
    }

    #main-wrapper.toggled .sidebar-text {
        display: none;
    }

    #main-wrapper.toggled .sidebar-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    /* Ocultar overlay en desktop */
    .sidebar-overlay {
        display: none;
    }

    .sidebar-close {
        display: none;
    }
}

/* ========================================
   MOBILE - SIDEBAR DESLIZABLE
   ======================================== */
@media (max-width: 1023px) {
    .sidebar-wrapper {
        transform: translateX(-100%);
    }

    .page-wrapper {
        margin-left: 0 !important;
    }

    /* Sidebar abierto */
    #main-wrapper.sidebar-toggled .sidebar-wrapper {
        transform: translateX(0);
    }
}

/* ========================================
   CONTENT BODY
   ======================================== */
.content-body {
    padding: 1.5rem;
    min-height: calc(100vh - 70px);
}

@media (max-width: 640px) {
    .content-body {
        padding: 1rem;
    }
}
