/* AMD Menu PRO - Frontend Styles (Light Mode) */
/* Archivo: assets/css/frontend.css */

/* Add padding to body ONLY when menu is present */
body:has(.amd-menu-pro) {
    padding-left: 80px;
}

/* Fallback for browsers that don't support :has() */
.amd-menu-active {
    padding-left: 80px;
}

.amd-menu-pro {
    position: fixed !important;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.amd-menu-container {
    width: 80px;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.08);
    border-right: 1px solid #e5e7eb;
}

/* Logo */
.amd-menu-logo {
    width: 50px;
    height: 50px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.amd-menu-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation */
.amd-menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    padding: 0 15px;
}

/* Menu Items */
.amd-menu-item {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    margin: 0 auto;
}

.amd-menu-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
    transform: translateX(5px);
}

.amd-menu-item.amd-active {
    background: linear-gradient(135deg, #eea58a 0%, #d88c70 100%);
    border-color: #eea58a;
    box-shadow: 0 4px 5px #926846;
}

.amd-menu-item.amd-active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 30px;
    background: linear-gradient(135deg, #eea58a 0%, #d88c70 100%);
    border-radius: 0 4px 4px 0;
}

.amd-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amd-item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    display: block;
}

.amd-menu-item:hover .amd-item-icon img {
    opacity: 0.8;
}

.amd-menu-item.amd-active .amd-item-icon img {
    opacity: 1;
    filter: brightness(0) invert(1);
}

/* Tooltip */
.amd-menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, margin-left 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
}

.amd-menu-item:hover::after {
    opacity: 1;
    margin-left: 20px;
}

/* User Avatar */
.amd-menu-user {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Logout Button */
.amd-logout-btn {
    width: auto;
    padding: 5px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6 !important;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.amd-logout-btn:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.15);
}

.amd-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.amd-user-avatar:hover {
    transform: scale(1.05);
    border-color: #d1d5db;
    background: #e5e7eb;
}

.amd-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.amd-user-avatar.amd-guest {
    background: #f9fafb;
}

.amd-user-avatar.amd-guest svg {
    width: 24px;
    height: 24px;
}

.amd-user-avatar.amd-guest svg circle,
.amd-user-avatar.amd-guest svg path {
    stroke: #9ca3af;
}

/* User Tooltip */
.amd-user-avatar::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, margin-left 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
}

.amd-user-avatar:hover::after {
    opacity: 1;
    margin-left: 20px;
}

/* Animation for active state */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(249, 115, 22, 0.25);
    }
    50% {
        box-shadow: 0 4px 25px rgba(249, 115, 22, 0.4);
    }
}

.amd-menu-item.amd-active {
    animation: pulse 2s ease-in-out infinite;
}

@media (max-width: 768px) {
    /* Remove desktop padding and add bottom padding for mobile menu */
    body {
        padding-left: 0 !important;
        padding-bottom: 90px !important;
    }
    
    /* Hide items not selected for mobile */
    .amd-menu-item.amd-hide-mobile {
        display: none !important;
    }
    
    div.amd-menu-pro {
        position: fixed !important;
        left: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        transform: none !important;
        z-index: 99999 !important;
    }
    
.amd-menu-container {
    width: 100% !important;
    height: auto !important;
    flex-direction: row !important;
    padding: 12px 20px 20px 20px !important;
    border-right: none !important;
    border-top: 1px solid #e5e7eb !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08) !important;
    position: relative !important;
    max-width: 500px !important;
    margin: 0 auto !important;
}
    
    /* Hide user avatar on mobile */
    .amd-menu-user {
        display: none;
    }
    
    /* Logo centered and elevated */
    .amd-menu-logo {
        position: absolute;
        width: 60px;
        height: 60px;
        top: -30px;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        border: 4px solid #ffffff;
        z-index: 10;
    }
    
    .amd-menu-logo img {
        border-radius: 50%;
    }
    
    /* Navigation horizontal */
    .amd-menu-nav {
        flex: 1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        gap: 0;
        max-width: 100%;
    }
    
    /* Menu items */
    .amd-menu-item {
        width: 50px;
        height: 50px;
        margin: 0;
        position: relative;
    }
    
/* Center gap for logo - works with any number of items */
.amd-menu-nav {
    justify-content: center !important;
    gap: 20px !important;
}

.amd-menu-logo {
    order: 2;
}

.amd-menu-item.amd-show-mobile:nth-child(1) {
    order: 1;
}

.amd-menu-item.amd-show-mobile:nth-child(2) {
    order: 3;
}

.amd-menu-item.amd-show-mobile:nth-child(3) {
    order: 4;
}

.amd-menu-item.amd-show-mobile:nth-child(4) {
    order: 5;
}
    
    /* Active state adjustments */
    .amd-menu-item.amd-active::before {
        display: none;
    }
    
    .amd-menu-item.amd-active {
        transform: translateY(-5px);
    }
    
    .amd-menu-item:hover {
        transform: translateY(-5px);
    }
    
    /* Tooltips - Position above */
    .amd-menu-item::after {
        left: 50%;
        top: auto;
        bottom: 100%;
        transform: translateX(-50%);
        margin-left: 0;
        margin-bottom: 10px;
    }
    
    .amd-menu-item:hover::after {
        margin-bottom: 15px;
    }
    
    /* Icon size */
    .amd-item-icon {
        width: 24px;
        height: 24px;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) and (min-width: 481px) {
    .amd-menu-container {
        max-width: 600px;
    }
    
    .amd-menu-item {
        width: 55px;
        height: 55px;
    }
    
    .amd-menu-logo {
        width: 70px;
        height: 70px;
        top: -35px;
    }
    
}