/* ============================================
   SIDEBAR STYLES - STANDALONE COMPONENT
   ============================================ */

/* ============================================
   SIDEBAR MAIN STRUCTURE
   ============================================ */
.sidebar {
    position: fixed;
    top: 76px;
    /* Height of header */
    left: -320px;
    width: 320px;
    height: calc(100vh - 76px);
    background: var(--primary-bg);
    box-shadow: 4px 0 20px var(--shadow-color);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 2px solid var(--border-color);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, var(--primary-bg) 0%, rgba(15, 8, 32, 0.98) 100%);
    border-right: 2px solid rgba(167, 139, 250, 0.3);
    box-shadow: 4px 0 30px rgba(107, 70, 193, 0.5);
}

.sidebar.active {
    left: 0;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ============================================
   SIDEBAR HEADER
   ============================================ */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.sidebar-title {
    flex: 1;
    margin-left: 1rem;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================
   SIDEBAR USER INFO
   ============================================ */
.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(167, 139, 250, 0.1);
    border-bottom: 2px solid var(--border-color);
    animation: slideDown 0.4s ease;
}

[data-theme="dark"] .sidebar-user-info {
    background: rgba(167, 139, 250, 0.15);
    border-bottom-color: rgba(167, 139, 250, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-user-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

.sidebar-user-details {
    flex: 1;
}

.sidebar-user-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.sidebar-user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--gradient-start), var(--gradient-end));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-link:hover::before,
.sidebar-link.active::before {
    transform: scaleY(1);
}

.sidebar-link:hover {
    background: rgba(167, 139, 250, 0.1);
    padding-left: 2rem;
}

[data-theme="dark"] .sidebar-link:hover {
    background: rgba(167, 139, 250, 0.15);
}

.sidebar-link.active {
    background: rgba(167, 139, 250, 0.15);
    color: var(--accent-color);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-link.active {
    background: rgba(167, 139, 250, 0.2);
}

.sidebar-link-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-bg);
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

[data-theme="dark"] .sidebar-link-icon {
    background: rgba(167, 139, 250, 0.1);
}

.sidebar-link:hover .sidebar-link-icon,
.sidebar-link.active .sidebar-link-icon {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

.sidebar-link-text {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link-arrow {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    opacity: 0;
}

.sidebar-link:hover .sidebar-link-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* Highlighted Links (Login/Register, Book Laundry) */
.sidebar-link-highlight {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.1), rgba(147, 51, 234, 0.1));
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    margin: 0.5rem 1rem;
    padding: 1rem 1.25rem;
}

[data-theme="dark"] .sidebar-link-highlight {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(196, 181, 253, 0.1));
    border-color: var(--accent-color);
}

.sidebar-link-highlight::before {
    display: none;
}

.sidebar-link-highlight:hover {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(107, 70, 193, 0.4);
}

.sidebar-link-highlight:hover .sidebar-link-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-link-highlight:hover .sidebar-link-arrow {
    color: white;
}

/* Logout Link */
.sidebar-link-logout {
    color: #ef4444;
    margin-top: 0.5rem;
}

.sidebar-link-logout .sidebar-link-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

[data-theme="dark"] .sidebar-link-logout .sidebar-link-icon {
    background: rgba(239, 68, 68, 0.15);
}

.sidebar-link-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.sidebar-link-logout:hover .sidebar-link-icon {
    background: #ef4444;
    color: white;
}

/* Order Badge */
.sidebar-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.4);
}

/* ============================================
   SIDEBAR SECTION DIVIDER
   ============================================ */
.sidebar-section-divider {
    padding: 1rem 1.5rem 0.5rem;
    margin-top: 1rem;
    border-top: 2px solid var(--border-color);
}

[data-theme="dark"] .sidebar-section-divider {
    border-top-color: rgba(167, 139, 250, 0.2);
}

.sidebar-section-divider span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   SIDEBAR FOOTER
   ============================================ */
.sidebar-footer {
    padding: 1.5rem;
    margin-top: auto;
    background: var(--secondary-bg);
    border-top: 2px solid var(--border-color);
}

[data-theme="dark"] .sidebar-footer {
    background: rgba(167, 139, 250, 0.05);
    border-top-color: rgba(167, 139, 250, 0.2);
}

.sidebar-footer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.sidebar-footer-item i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    border-radius: 8px;
    color: var(--accent-color);
    font-size: 0.9rem;
}

[data-theme="dark"] .sidebar-footer-item i {
    background: rgba(167, 139, 250, 0.1);
}

.sidebar-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .sidebar-social {
    border-top-color: rgba(167, 139, 250, 0.2);
}

.sidebar-social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.3);
}

.sidebar-social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 16px rgba(107, 70, 193, 0.4);
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100vh - 76px);
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    backdrop-filter: blur(4px);
}

[data-theme="dark"] .sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }

    .sidebar-header {
        padding: 1.25rem;
    }

    .sidebar-title {
        font-size: 1.15rem;
    }

    .sidebar-user-info {
        padding: 1.25rem;
    }

    .sidebar-link {
        padding: 0.9rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 260px;
        left: -260px;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-logo {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .sidebar-title {
        font-size: 1.05rem;
    }

    .sidebar-close {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .sidebar-user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.7rem;
    }

    .sidebar-user-name {
        font-size: 1rem;
    }

    .sidebar-user-email {
        font-size: 0.8rem;
    }

    .sidebar-link {
        padding: 0.85rem 1rem;
        gap: 0.85rem;
    }

    .sidebar-link-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .sidebar-link-text {
        font-size: 0.9rem;
    }

    .sidebar-footer {
        padding: 1.25rem;
    }

    .sidebar-footer-item {
        font-size: 0.8rem;
    }

    .sidebar-social-link {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   SMOOTH ANIMATIONS
   ============================================ */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Staggered animation for sidebar links */
.sidebar.active .sidebar-link {
    animation: slideInLeft 0.4s ease forwards;
}

.sidebar.active .sidebar-link:nth-child(1) {
    animation-delay: 0.05s;
}

.sidebar.active .sidebar-link:nth-child(2) {
    animation-delay: 0.1s;
}

.sidebar.active .sidebar-link:nth-child(3) {
    animation-delay: 0.15s;
}

.sidebar.active .sidebar-link:nth-child(4) {
    animation-delay: 0.2s;
}

.sidebar.active .sidebar-link:nth-child(5) {
    animation-delay: 0.25s;
}

.sidebar.active .sidebar-link:nth-child(6) {
    animation-delay: 0.3s;
}