/* --- Base --- */
#fd-global-nav-bar {
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box;
}

.fd-nav-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.fd-nav-divider { 
    width: 80%; 
    height: 1px; 
    background: rgba(0,0,0,0.1); 
    margin: 4px 0; 
}

.fd-nav-item {
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 36px; 
    height: 36px;
    background: transparent !important; 
    border: none !important;
    color: #333 !important; 
    cursor: pointer; 
    border-radius: 50%;
    margin: 4px 0; 
    padding: 0 !important; 
    flex-shrink: 0;
    box-sizing: border-box;
}

.fd-nav-item:hover, .fd-nav-item.active {
    color: #D4AF37 !important; 
    background-color: rgba(212, 175, 55, 0.1) !important;
    transform: scale(1.1);
}

.fd-nav-item svg { 
    width: 22px !important; 
    height: 22px !important; 
    stroke: currentColor !important; 
    display: block; 
    stroke-width: 2px; 
}

/* --- Favorites Panel (Fixed Global) --- */
#fd-fav-panel {
    position: fixed; 
    width: 220px; /* Reduced width for slimmer look */
    max-height: 400px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 12px;
    display: flex; 
    flex-direction: column;
    z-index: 999999;
    
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none;
    
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#fd-fav-panel.open { 
    opacity: 1; 
    visibility: visible; 
    pointer-events: auto;
    transform: scale(1); 
}

.fd-fav-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 8px; 
}

.fd-fav-title { 
    font-weight: bold; 
    font-size: 13px; 
    color: #333; 
}

#fd-fav-close { 
    background: none; 
    border: none; 
    font-size: 18px; 
    cursor: pointer; 
    color: #999; 
    padding: 0; 
}

.fd-fav-actions { 
    margin-bottom: 8px; 
}

.fd-btn-action { 
    width: 100%; 
    padding: 8px; 
    border-radius: 6px; 
    border: 1px dashed #D4AF37; 
    background: #FFFBF0; 
    color: #D4AF37; 
    cursor: pointer; 
    font-size: 11px; 
    font-weight: 600;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 5px;
}

.fd-btn-action.saved { 
    background: #D4AF37; 
    color: #fff; 
    border-style: solid; 
}

#fd-fav-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    overflow-y: auto; 
    flex-grow: 1; 
}

#fd-fav-list li { 
    margin-bottom: 4px; 
}

#fd-fav-list a { 
    display: block; 
    padding: 6px 10px; 
    border-radius: 6px; 
    background: #f9f9f9; 
    color: #555; 
    text-decoration: none; 
    font-size: 12px; 
    transition: all 0.2s;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    position: relative;
}

#fd-fav-list a:hover { 
    background: #eee; 
    color: #000; 
}

.fd-fav-delete { 
    position: absolute; 
    right: 5px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 20px; 
    height: 20px; 
    background: none; 
    border: none; 
    color: #ccc; 
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 16px; 
}

.fd-fav-delete:hover { 
    color: red; 
}

.fd-fav-empty { 
    text-align: center; 
    color: #aaa; 
    font-size: 11px; 
    padding: 15px 0; 
}

/* --- Desktop Layout (Navbar) --- */
@media (min-width: 769px) {
    #fd-global-nav-bar {
        position: fixed; 
        top: 50%; 
        right: 20px; 
        transform: translateY(-50%);
        flex-direction: column; 
        padding: 12px 0; 
        border-radius: 50px; 
        width: 44px;
        min-height: 100px;
    }

    .fd-nav-content { 
        flex-direction: column; 
        width: 100%;
        align-items: center !important; 
        justify-content: center !important;
    }

    .fd-nav-item {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    #fd-nav-toggle svg { 
        transform: rotate(0deg); 
    }
    
    #fd-global-nav-bar.is-minimized { 
        width: 40px; 
        height: 40px; 
        padding: 0; 
        right: 15px; 
        opacity: 0.6; 
        min-height: 40px;
    }
    
    #fd-global-nav-bar.is-minimized #fd-nav-toggle svg { 
        transform: rotate(180deg); 
    }
}

/* --- Mobile Layout (Navbar) --- */
@media (max-width: 768px) {
    #fd-global-nav-bar {
        position: fixed; 
        bottom: 30px; 
        left: 50%; 
        transform: translate(-50%, 0);
        flex-direction: row; 
        padding: 6px 20px; 
        border-radius: 24px; 
        width: auto; 
        min-width: 220px; 
        justify-content: space-between; 
        gap: 10px;
    }
    
    .fd-nav-content { 
        flex-direction: row; 
        gap: 15px; 
    }
    
    .fd-nav-divider { 
        width: 1px; 
        height: 20px; 
        margin: 0 5px; 
    }
    
    #fd-nav-toggle { 
        order: 2; 
        margin-left: 5px; 
    }
    
    #fd-nav-toggle svg { 
        transform: rotate(90deg); 
    }
    
    #fd-global-nav-bar.is-minimized { 
        width: 44px; 
        height: 44px; 
        padding: 0; 
        bottom: 20px; 
        left: auto; 
        right: 20px; 
        transform: none; 
        opacity: 0.7; 
        min-width: 0;
    }
    
    #fd-global-nav-bar.is-minimized #fd-nav-toggle svg { 
        transform: rotate(-90deg); 
    }
}

#fd-global-nav-bar.is-minimized .fd-nav-content { 
    display: none !important; 
}
