/* ===================================================================
   COMPONENTS/SIDEBAR-MODERN.CSS
   Modern Sidebar with Smooth Animations
   =================================================================== */

/* ===== SIDEBAR BACKDROP ===== */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ===== SIDEBAR CONTAINER ===== */
.modern-sidebar {
    position: fixed;
    top: 251px; /* Align sidebar search with main search bar */
    left: 10px;
    width: 200px;
    max-height: 500px;
    background-color: #1c2128;
    border: 1px solid rgba(0, 136, 204, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(-300px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.modern-sidebar.open {
    transform: translateX(0);
    opacity: 1;
}

/* ===== SIDEBAR HEADER ===== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px 8px 0 0;
}

.sidebar-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #0088cc;
    text-transform: uppercase;
}

.sidebar-close {
    display: none;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.sidebar-close:hover {
    color: #0088cc;
    transform: rotate(90deg);
}

/* ===== SIDEBAR SEARCH ===== */
.sidebar-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px 8px 0 0;
    background-color: transparent;
}

.sidebar-search-input {
    width: 100%;
    padding: 10px 12px;
    background-color: rgba(42, 47, 52, 0.8);
    border: 1px solid transparent;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.sidebar-search-input:focus {
    outline: none;
    border-color: #0088cc;
}

.sidebar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ===== SIDEBAR LIST ===== */
.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* ===== SIDEBAR ITEMS ===== */
.sidebar-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: #0088cc;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background-color: rgba(0, 136, 204, 0.1);
    transition: width 0.2s ease;
}

.sidebar-item:hover {
    color: #00a8ff;
    background-color: rgba(0, 136, 204, 0.05);
}

.sidebar-item:hover::before {
    width: 100%;
}

.sidebar-item.active {
    color: #00a8ff;
    background-color: rgba(0, 136, 204, 0.15);
    border-left-color: #0088cc;
    font-weight: 600;
}

.sidebar-item.active::before {
    width: 100%;
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 991px) {
    .modern-sidebar {
        top: 0;
        left: 0;
        max-height: 100vh;
        width: 280px;
        max-width: 85vw;
        border-radius: 0;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar-header {
        border-radius: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-backdrop {
        display: block;
    }
}

@media (max-width: 768px) {
    .modern-sidebar {
        width: 260px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== MAIN CONTENT ADJUSTMENT ===== */
/* NOTE: Body padding moved to pages/database.css */

/* No margin adjustment needed - sidebar is floating */


/* ===== SIDEBAR TOGGLE BUTTON (FLOATING) ===== */
.sidebar-toggle-btn {
    position: fixed;
    top: 206.5px;
    left: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background-color: rgba(0, 136, 204, 0.15);
    border: 1px solid #0088cc;
    border-radius: 6px;
    color: #0088cc;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 136, 204, 0.3);
}

.sidebar-toggle-btn:hover {
    background-color: rgba(0, 136, 204, 0.25);
    border-color: #00a8ff;
    color: #00a8ff;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.5);
}

.sidebar-toggle-btn:active {
    /* Removed translateY to prevent lift */
}

.sidebar-toggle-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .sidebar-toggle-btn {
        top: 80px;
        left: 15px;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .sidebar-toggle-btn span {
        display: inline;
    }
}
