@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bs-body-font-family: 'Inter', sans-serif;
    --sidebar-width: 280px;
    --header-height: 70px;
    --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --secondary-gradient: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
    transition: background-color var(--transition-speed);
}

[data-bs-theme="dark"] body {
    background-color: #121826;
}

/* Sidebar styling */
.sidebar {
    height: 100vh;
    position: fixed;
    width: var(--sidebar-width);
    background: var(--secondary-gradient);
    padding: 0;
    z-index: 1050;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed);
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    /* Fixed: remove underline from link */
}

.sidebar-brand i {
    background: var(--primary-gradient);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1.5rem;
    margin: 0.15rem 0.5rem;
    border-radius: 8px;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1rem;
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
}

/* Main content area */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    transition: margin var(--transition-speed);
    min-height: 100vh;
    /* Ensure full height */
}

/* Header styling */
.header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 100;
    background-color: var(--bs-body-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: left var(--transition-speed);
    padding: 0 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
    transition: opacity 0.3s ease;
}

/* Theme switcher */
.theme-switcher {
    display: flex;
    background: var(--bs-tertiary-bg);
    border-radius: 50px;
    padding: 5px;
}

.theme-switcher button {
    border: none;
    background: transparent;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-body-color);
}

.theme-switcher button.active {
    background: var(--bs-primary);
    color: white;
}

/* Notification dropdown */
.notification-dropdown .dropdown-menu {
    width: 350px;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background var(--transition-speed);
}

.notification-item:hover {
    background-color: var(--bs-tertiary-bg);
}

/* Cards styling */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--bs-primary);
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Tables */
.data-table th {
    font-weight: 600;
    color: var(--bs-heading-color);
    background-color: var(--bs-tertiary-bg);
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
    background: var(--bs-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
}

/* Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.sidebar-backdrop.active {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content,
    .header {
        left: 0;
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .close-sidebar-btn {
        display: block;
    }

    /* Smart Expandable Search Bar CSS */
    .header.search-expanded .header-actions {
        display: none;
    }

    .input-group.search-wrapper {
        width: 40px !important;
        background: transparent;
        border-color: transparent;
        transition: all 0.3s ease;
    }

    .header.search-expanded .search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        background: var(--bs-body-bg);
        border: 1px solid var(--bs-border-color) !important;
    }

    .search-wrapper:not(.header.search-expanded .search-wrapper) .search-input {
        padding-left: 0;
        background: transparent;
        border: none;
        color: transparent;
    }

    .search-wrapper:not(.header.search-expanded .search-wrapper) .search-input::placeholder {
        color: transparent;
    }

    .header.search-expanded .search-wrapper .search-input {
        padding: 10px 40px 10px 15px;
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-tertiary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: 4px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Chat styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    background-color: var(--bs-body-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.chat-header {
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.message {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    position: relative;
}

.message-in {
    background: var(--bs-primary);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.message-out {
    background: var(--bs-tertiary-bg);
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chat-input {
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
}

/* Invoice styles */
.invoice-card {
    background-color: white;
    color: #333;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

[data-bs-theme="dark"] .invoice-card {
    background-color: #1e293b;
    color: #f8f9fa;
}

.invoice-header {
    padding: 2rem;
    background: var(--primary-gradient);
    color: white;
}

.invoice-body {
    padding: 2rem;
}

.invoice-footer {
    padding: 2rem;
    background: var(--bs-tertiary-bg);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--bs-border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-icon {
    position: absolute;
    left: -30px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-content {
    padding-left: 1rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.product-card {
    overflow: hidden;
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-img {
    height: 200px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Settings Tabs */
.settings-tabs .nav-link {
    color: var(--bs-body-color);
    border-radius: 0;
    margin: 0;
    padding: 1rem;
    border-left: 3px solid transparent;
}

.settings-tabs .nav-link.active {
    background: var(--bs-tertiary-bg);
    border-left-color: var(--bs-primary);
}

/* Search Styles */
.input-group.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    transition: all 0.3s ease;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--bs-border-color);
    border-radius: 25px !important;
    outline: none;
    transition: all 0.3s ease;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    z-index: 2;
}

.search-button i {
    color: var(--bs-body-color);
    opacity: 0.7;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.auth-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-body {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.text-white-80 {
    color: rgba(255, 255, 255, 0.8) !important;
}