﻿:root {
    --sidebar-width: 280px;
    --sidebar-bg: #007bff;
    --sidebar-text: #ffffff;
    --sidebar-text-light: #e7f0ff;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f6fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes chevronRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(180deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }
}

/* ============================================================================
   SIDEBAR STYLES
   ============================================================================ */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.5s ease-out;
}

    .sidebar-header h5 {
        font-weight: 700;
        font-size: 1.25rem;
        letter-spacing: 0.5px;
        margin: 0;
        color: var(--sidebar-text);
    }

    .sidebar-header small {
        color: var(--sidebar-text-light);
        font-size: 0.8rem;
        font-weight: 500;
        letter-spacing: 0.3px;
        display: block;
        margin-top: 0.25rem;
    }

.sidebar-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1.5rem;
    animation: iconFloat 3s ease-in-out infinite;
}

/* Header Divider */
.sidebar-divider {
    position: relative;
    padding: 0.75rem 1rem;
    overflow: hidden;
}

.divider-line {
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* Navigation Menu */
.sidebar .nav {
    flex: 1;
    padding: 0.5rem 0;
}

.nav-item {
    animation: slideInRight 0.5s ease-out;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.12);
        color: var(--sidebar-text);
        border-left-color: var(--sidebar-text);
        padding-left: 1.25rem;
    }

    .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
        color: var(--sidebar-text);
        border-left-color: var(--sidebar-text);
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    }

/* Enhanced Nav Links */
.nav-link-enhanced {
    justify-content: space-between;
}

.nav-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.nav-link:hover .nav-icon-wrapper,
.nav-link.active .nav-icon-wrapper {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.nav-text {
    flex: 1;
    min-width: 0;
}

.nav-chevron {
    display: flex;
    align-items: center;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.nav-link[data-bs-toggle="collapse"] .nav-chevron {
    transform: rotate(0deg);
}

.nav-link[data-bs-toggle="collapse"][aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.nav-link.active .nav-badge {
    opacity: 1;
}

/* Section Divider in Menu */
.nav-divider {
    list-style: none;
    padding: 1rem 1rem 0.5rem 1rem;
    margin: 0.5rem 0;
}

.divider-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    position: relative;
    padding-left: 12px;
}

    .divider-label::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 3px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 50%;
    }

/* Nested Navigation */
.nested-nav {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0 !important;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
}

.nested-link {
    padding: 0.65rem 1rem !important;
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.75) !important;
    border-left: none !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

    .nested-link:hover {
        color: var(--sidebar-text) !important;
        background: rgba(255, 255, 255, 0.08) !important;
        padding-left: 1.25rem !important;
    }

    .nested-link.active {
        color: var(--sidebar-text) !important;
        background: rgba(255, 255, 255, 0.12) !important;
    }

.nested-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* Spacer */
.sidebar-spacer {
    flex: 1;
    min-height: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0;
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

.footer-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.user-profile-card {
    padding: 1rem 1rem !important;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

    .user-profile-card:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.user-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-card:hover .user-avatar {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border: 2px solid var(--sidebar-bg);
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
}

.user-info small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-card:hover .user-avatar-fallback {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Update avatar wrapper to accommodate both img and div */
.user-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Add this to your admin-layout.css */

.avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.user-dropdown-btn:hover .avatar-small {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
    .user-info small.fw-600 {
        font-weight: 600;
    }

.dropdown-button {
    opacity: 0.8;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.25rem 0.5rem !important;
}

    .dropdown-button:hover {
        opacity: 1;
        transform: scale(1.15);
    }

.dropdown-menu-dark {
    background-color: #1a1f35;
    border-color: rgba(255, 255, 255, 0.1);
}

    .dropdown-menu-dark .dropdown-item {
        color: rgba(255, 255, 255, 0.8);
        transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    }

        .dropdown-menu-dark .dropdown-item:hover {
            background-color: rgba(0, 123, 255, 0.3);
            color: var(--sidebar-text);
        }

        .dropdown-menu-dark .dropdown-item.text-danger:hover {
            background-color: rgba(220, 53, 69, 0.3);
        }

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: background var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.4);
    }

/* ============================================================================
   HEADER STYLES
   ============================================================================ */

.header-shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

header {
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    animation: slideInDown 0.5s ease-out;
}

    header h6 {
        color: var(--sidebar-text);
        font-weight: 600;
        letter-spacing: 0.5px;
    }

.header-title {
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-btn {
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

    .sidebar-toggle-btn:hover {
        background-color: rgba(255, 255, 255, 0.2) !important;
    }

header .btn-outline-light {
    color: var(--sidebar-text);
    border-color: rgba(255, 255, 255, 0.5);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

    header .btn-outline-light:hover {
        background-color: rgba(255, 255, 255, 0.15);
        border-color: var(--sidebar-text);
        transform: scale(1.05);
    }

header .vr {
    opacity: 0.5;
    height: 20px;
}

/* Notification Badge */
.notification-wrapper {
    animation: slideInRight 0.5s ease-out;
}

.notification-btn {
    position: relative;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

    .notification-btn:hover {
        transform: scale(1.1) rotate(5deg);
    }

.notification-badge {
    animation: pulseGlow 2s infinite;
    font-size: 0.65rem !important;
}

.user-dropdown-btn {
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

    .user-dropdown-btn:hover {
        opacity: 0.9;
    }

/* ============================================================================
   MAIN CONTENT STYLES
   ============================================================================ */

.main-content {
    margin-left: var(--sidebar-width);
    background-color: #f5f6fa;
    transition: margin-left var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

main {
    min-height: calc(100vh - 200px);
    animation: fadeIn 0.5s ease-out;
}

.breadcrumb-section {
    animation: slideInRight 0.5s ease-out 0.1s backwards;
}

footer {
    background-color: white;
    color: var(--secondary-color);
    animation: slideInDown 0.5s ease-out 0.2s backwards;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .nav-text {
        max-width: 200px;
    }
}

/* ============================================================================
   CARD STYLES
   ============================================================================ */

.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

    .card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
    }

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: var(--secondary-color);
    border-radius: 8px 8px 0 0;
}

/* ============================================================================
   BUTTON STYLES
   ============================================================================ */

.btn-primary {
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    border: none;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #0052cc 0%, #003d99 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 82, 204, 0.3);
    }

    .btn-primary:focus {
        box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.5);
    }

/* ============================================================================
   TABLE STYLES
   ============================================================================ */

.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

    .table thead th {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        color: var(--secondary-color);
        padding: 1rem;
    }

    .table tbody tr {
        transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    }

        .table tbody tr:hover {
            background-color: rgba(0, 123, 255, 0.05);
        }

/* ============================================================================
   ALERT STYLES
   ============================================================================ */

.alert {
    border-radius: 8px;
    border: none;
    animation: slideInDown 0.3s ease-out;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-muted {
    color: var(--secondary-color) !important;
}

.border-subtle {
    border-color: #e9ecef !important;
}
