/* Custom CSS cho Dropshipping Team Manager */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Body và Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* Sidebar Layout */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background: #ffffff;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-right: 1px solid #e9ecef;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.sidebar-brand {
    color: #495057;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-brand:hover {
    color: #007bff;
    text-decoration: none;
}

.sidebar-brand i {
    margin-right: 0.5rem;
    font-size: 1.5rem;
    color: #007bff;
}

.sidebar.collapsed .sidebar-brand span {
    display: none;
}

.sidebar.collapsed .sidebar-brand i {
    margin-right: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    color: #6c757d;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    margin: 0;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    color: #007bff;
    background-color: #e3f2fd;
    border-right: 3px solid #007bff;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
    color: #6c757d;
}

.sidebar-nav .nav-link:hover i {
    color: #007bff;
}

.sidebar-nav .nav-link.active i {
    color: #007bff;
}

.sidebar.collapsed .sidebar-nav .nav-link span {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
}

.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.sidebar-user .dropdown-toggle {
    color: #495057;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.sidebar-user .dropdown-toggle:hover {
    background-color: #e9ecef;
    color: #007bff;
    text-decoration: none;
}

.sidebar-user .dropdown-toggle i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
    color: #6c757d;
}

.sidebar-user .dropdown-toggle:hover i {
    color: #007bff;
}

.sidebar.collapsed .sidebar-user .dropdown-toggle span {
    display: none;
}

.sidebar.collapsed .sidebar-user .dropdown-toggle {
    justify-content: center;
}

.sidebar.collapsed .sidebar-user .dropdown-toggle i {
    margin-right: 0;
}

/* Main content area */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.main-content.sidebar-collapsed {
    margin-left: 70px;
}

/* Top bar */
.topbar {
    background: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Content area */
.content-area {
    padding: 1.5rem;
}

/* Mobile sidebar */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Navigation - Legacy styles for backward compatibility */
.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    margin: 0 0.2rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Ensure cards don't interfere with dropdowns */
.card-body {
    overflow: visible !important;
}

.card .dropdown {
    z-index: 100 !important;
}

.card .dropdown.show {
    z-index: 10000 !important;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    border-radius: 1rem;
    overflow: hidden;
}

/* Enhanced Dashboard Stats Cards */
.card.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3) !important;
    transition: all 0.3s ease !important;
}

.card.bg-primary:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    border: none !important;
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.3) !important;
    transition: all 0.3s ease !important;
}

.card.bg-success:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(17, 153, 142, 0.4) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    border: none !important;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3) !important;
    transition: all 0.3s ease !important;
}

.card.bg-warning:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(240, 147, 251, 0.4) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    border: none !important;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3) !important;
    transition: all 0.3s ease !important;
}

.card.bg-info:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.4) !important;
}

/* Enhanced Icons in Stats Cards */
.card.bg-primary i,
.card.bg-success i,
.card.bg-warning i,
.card.bg-info i {
    transition: all 0.3s ease !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

.card.bg-primary:hover i,
.card.bg-success:hover i,
.card.bg-warning:hover i,
.card.bg-info:hover i {
    transform: scale(1.1) rotate(5deg) !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) !important;
}

/* Pulse animation for numbers */
.card.bg-primary h3,
.card.bg-success h3,
.card.bg-warning h3,
.card.bg-info h3 {
    animation: pulse 2s infinite !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Shimmer effect for card titles */
.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-warning .card-title,
.card.bg-info .card-title {
    position: relative !important;
    overflow: hidden !important;
}

.card.bg-primary .card-title::before,
.card.bg-success .card-title::before,
.card.bg-warning .card-title::before,
.card.bg-info .card-title::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    animation: shimmer 3s infinite !important;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Enhanced card body with better spacing */
.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-warning .card-body,
.card.bg-info .card-body {
    position: relative !important;
    z-index: 2 !important;
}

/* Floating particles effect (optional) */
.card.bg-primary::before,
.card.bg-success::before,
.card.bg-warning::before,
.card.bg-info::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Enhanced Quick Action Buttons */
.card.bg-info .btn-light {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #333 !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.card.bg-info .btn-light:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    color: #000 !important;
}

.card.bg-info .btn-light i {
    transition: all 0.3s ease !important;
}

.card.bg-info .btn-light:hover i {
    transform: scale(1.1) !important;
}

/* Glow effect for card numbers */
.card.bg-primary h3,
.card.bg-success h3,
.card.bg-warning h3,
.card.bg-info h3 {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3) !important;
    font-weight: 700 !important;
}

/* Enhanced small text in cards */
.card.bg-primary small,
.card.bg-success small,
.card.bg-warning small,
.card.bg-info small {
    opacity: 0.9 !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.stats-card .card-body {
    position: relative;
}

.stats-card .stats-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 3rem;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffca2c 100%);
    border: none;
    color: #000;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #b02a37 100%);
    border: none;
}

/* Forms */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

.form-select {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Tables */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateX(2px);
}

/* Badges */
.badge {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    position: relative;
    z-index: 5;
    background-clip: padding-box;
}

/* Product Cards */
.product-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.product-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: transparent !important;
}

.product-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

/* Task Cards */
.task-card {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.task-card.priority-high {
    border-left-color: var(--danger-color);
}

.task-card.priority-medium {
    border-left-color: var(--warning-color);
}

.task-card.priority-low {
    border-left-color: var(--info-color);
}

.task-card:hover {
    transform: translateX(3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Media Gallery */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.media-item {
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.media-item:hover {
    transform: scale(1.05);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.media-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #f8f9fa;
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-item:hover .media-overlay {
    opacity: 1;
}

/* Chat */
.chat-container {
    height: 400px;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.chat-message.own {
    justify-content: flex-end;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 0.75rem;
}

.chat-message.own .chat-avatar {
    margin-right: 0;
    margin-left: 0.75rem;
    order: 2;
}

.chat-bubble {
    background-color: white;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 70%;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.chat-message.own .chat-bubble {
    background-color: var(--primary-color);
    color: white;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background-color: white;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Calendar */
.calendar-view {
    background-color: white;
    border-radius: 0.75rem;
    padding: 1rem;
}

/* Chart.js responsive fixes */
.chart-container {
    position: relative !important;
    overflow: hidden;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    height: auto !important;
}

/* Dashboard chart specific fixes */
#productStatusChart {
    max-width: 100% !important;
    max-height: 300px !important;
}

/* Prevent chart overflow on mobile */
@media (max-width: 768px) {
    .chart-container {
        max-width: 280px;
        height: 280px !important;
        margin: 0 auto;
    }
    
    #productStatusChart {
        max-height: 250px !important;
    }
}

@media (max-width: 576px) {
    .chart-container {
        max-width: 250px;
        height: 250px !important;
    }
    
    #productStatusChart {
        max-height: 220px !important;
    }
}

/* Chart loading state */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
}

/* Chart empty state styling */
.chart-empty-state {
    padding: 2rem;
    text-align: center;
}

.chart-empty-state i {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Chart fallback badges */
.chart-fallback .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
}

/* Pagination */
.pagination {
    border-radius: 0.5rem;
    overflow: hidden;
}

.page-link {
    border: none;
    padding: 0.75rem 1rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%);
    color: #055160;
    border-left: 4px solid var(--info-color);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #f8f9fa;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Responsive Design */

/* Mobile First - Base styles for mobile */
@media (max-width: 576px) {
    /* Container and layout adjustments */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Typography */
    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    /* Navigation - Mobile specific */
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-link i {
        width: 24px !important;
        font-size: 1rem !important;
    }
    
    /* Mobile navbar collapse styling */
    .navbar-collapse {
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Forms */
    .form-control, .form-select {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .form-control-sm, .form-select-sm {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    /* Tables - force card view on mobile */
    .table-responsive {
        display: none;
    }
    
    /* Badges and small elements */
    .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.4em;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Pagination */
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Stats cards */
    .stats-card .stats-icon {
        font-size: 2rem;
        right: 0.75rem;
    }
    
    /* Media gallery */
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .media-preview {
        height: 120px;
    }
    
    /* Chat */
    .chat-bubble {
        max-width: 90%;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .chat-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Tablet styles */
@media (min-width: 577px) and (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Navigation - Tablet specific */
    .navbar-nav .nav-link {
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 0.5rem 0.875rem !important;
        font-size: 0.9rem !important;
    }
    
    .navbar-nav .nav-link i {
        width: 22px !important;
        font-size: 0.95rem !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Grid adjustments */
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .media-preview {
        height: 140px;
    }
    
    /* Chat */
    .chat-bubble {
        max-width: 85%;
    }
    
    /* Show both table and cards, let user choose or auto-switch */
    .table-responsive {
        border-radius: 0.5rem;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    /* Navigation - Desktop specific - Perfect alignment */
    .navbar-nav .nav-link {
        margin: 0 0.25rem !important;
        border-radius: 0.375rem !important;
        padding: 0.5rem 1rem !important;
        font-size: 1rem !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        line-height: 1 !important;
        min-height: 48px !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        word-wrap: normal !important;
        overflow: visible !important;
        flex-wrap: nowrap !important;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
        transform: translateY(-1px) !important;
    }
    
    .navbar-nav .nav-link i {
        width: 20px !important;
        height: 20px !important;
        font-size: 1rem !important;
        line-height: 20px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 0.5rem !important;
        flex-shrink: 0 !important;
    }
    
    .navbar-nav .nav-link span {
        line-height: 1 !important;
        display: inline-block !important;
        vertical-align: top !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow: visible !important;
    }
    
    /* Enhanced card hover */
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
    
    /* Table enhancements */
    .table tbody tr:hover {
        background-color: rgba(13, 110, 253, 0.05);
        transform: translateX(2px);
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Enhanced spacing for large screens */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.25rem;
    }
}

/* Print styles */
@media print {
    .navbar, .btn, .pagination, .modal, .toast {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
}

/* Light Theme (Default) */
body {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Force Light Theme - Override system dark mode */
.light-theme {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.light-theme .card {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.light-theme .card-header {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.light-theme .form-control, 
.light-theme .form-select {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.light-theme .form-control:focus, 
.light-theme .form-select:focus {
    background-color: #ffffff !important;
    border-color: var(--primary-color) !important;
    color: #212529 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.light-theme .form-control::placeholder {
    color: #6c757d !important;
}

.light-theme .input-group-text {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.light-theme .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.light-theme .dropdown-item {
    color: #212529 !important;
}

.light-theme .dropdown-item:hover,
.light-theme .dropdown-item:focus {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.light-theme .dropdown-divider {
    border-color: #dee2e6 !important;
}

.light-theme .table {
    color: #212529 !important;
}

.light-theme .table thead th {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

.light-theme .table tbody tr {
    border-color: #dee2e6 !important;
}

.light-theme .table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.light-theme .btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
}

.light-theme .btn-outline-secondary:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.light-theme .text-muted {
    color: #6c757d !important;
}

.light-theme .text-dark {
    color: #212529 !important;
}

.light-theme .border {
    border-color: #dee2e6 !important;
}

.light-theme .modal-content {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.light-theme .modal-header {
    border-bottom: 1px solid #dee2e6 !important;
}

.light-theme .modal-footer {
    border-top: 1px solid #dee2e6 !important;
}

.light-theme .list-group-item {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.light-theme .page-link {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.light-theme .page-link:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.light-theme .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.light-theme .progress {
    background-color: #e9ecef !important;
}

.light-theme .chat-container {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.light-theme .chat-messages {
    background-color: #f8f9fa !important;
}

.light-theme .chat-bubble {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.light-theme .chat-message.own .chat-bubble {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.light-theme .chat-input {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

/* Manual Dark Theme Support */
.dark-theme {
    /* Root variables for dark mode */
    --dark-bg-primary: #121212;
    --dark-bg-secondary: #1e1e1e;
    --dark-bg-elevated: #2d2d2d;
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #b3b3b3;
    --dark-border: #404040;
}

.dark-theme {
    /* Base elements */
    background-color: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
}

.dark-theme .navbar-dark {
    background-color: #1a1a1a !important;
}

.dark-theme .navbar-brand, 
.dark-theme .navbar-nav .nav-link {
    color: var(--dark-text-primary) !important;
}

.dark-theme .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--dark-text-primary) !important;
}

/* Cards */
.dark-theme .card {
    background-color: var(--dark-bg-elevated) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border) !important;
}

.dark-theme .card-header {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-bottom: 1px solid var(--dark-border) !important;
}

/* Forms */
.dark-theme .form-control, 
.dark-theme .form-select {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

.dark-theme .form-control:focus, 
.dark-theme .form-select:focus {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--primary-color) !important;
    color: var(--dark-text-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.dark-theme .form-control::placeholder {
    color: var(--dark-text-secondary) !important;
}

.dark-theme .input-group-text {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

/* Dropdowns */
.dark-theme .dropdown-menu {
    background-color: var(--dark-bg-elevated) !important;
    border: 1px solid var(--dark-border) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5) !important;
}

.dark-theme .dropdown-item {
    color: var(--dark-text-primary) !important;
}

.dark-theme .dropdown-item:hover,
.dark-theme .dropdown-item:focus {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.dark-theme .dropdown-divider {
    border-color: var(--dark-border) !important;
}

/* Tables */
.dark-theme .table {
    color: var(--dark-text-primary) !important;
}

.dark-theme .table thead th {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border) !important;
}

.dark-theme .table tbody tr {
    border-color: var(--dark-border) !important;
}

.dark-theme .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Buttons */
.dark-theme .btn-outline-secondary {
    color: var(--dark-text-primary) !important;
    border-color: var(--dark-border) !important;
}

.dark-theme .btn-outline-secondary:hover {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

/* Alerts */
.dark-theme .alert-info {
    background-color: rgba(13, 202, 240, 0.2) !important;
    color: #9fdbf0 !important;
    border-color: rgba(13, 202, 240, 0.3) !important;
}

.dark-theme .alert-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #ffd43b !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
}

.dark-theme .alert-success {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #75b798 !important;
    border-color: rgba(25, 135, 84, 0.3) !important;
}

.dark-theme .alert-danger {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #ea868f !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
}

/* Badges */
.dark-theme .badge {
    color: white !important;
}

.dark-theme .badge.bg-light {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
}

/* Text colors */
.dark-theme .text-muted {
    color: var(--dark-text-secondary) !important;
}

.dark-theme .text-dark {
    color: var(--dark-text-primary) !important;
}

/* Borders */
.dark-theme .border {
    border-color: var(--dark-border) !important;
}

/* Chat specific */
.dark-theme .chat-container {
    background-color: var(--dark-bg-elevated) !important;
    border-color: var(--dark-border) !important;
}

.dark-theme .chat-messages {
    background-color: var(--dark-bg-secondary) !important;
}

.dark-theme .chat-bubble {
    background-color: var(--dark-bg-elevated) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border) !important;
}

.dark-theme .chat-message.own .chat-bubble {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.dark-theme .chat-input {
    background-color: var(--dark-bg-elevated) !important;
    border-color: var(--dark-border) !important;
}

/* Modal */
.dark-theme .modal-content {
    background-color: var(--dark-bg-elevated) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border) !important;
}

.dark-theme .modal-header {
    border-bottom: 1px solid var(--dark-border) !important;
}

.dark-theme .modal-footer {
    border-top: 1px solid var(--dark-border) !important;
}

/* List groups */
.dark-theme .list-group-item {
    background-color: var(--dark-bg-elevated) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border) !important;
}

/* Pagination */
.dark-theme .page-link {
    background-color: var(--dark-bg-elevated) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

.dark-theme .page-link:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.dark-theme .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Progress bars */
.dark-theme .progress {
    background-color: var(--dark-bg-secondary) !important;
}

/* Tooltips and popovers */
.dark-theme .tooltip-inner {
    background-color: var(--dark-bg-elevated) !important;
    color: var(--dark-text-primary) !important;
}

.dark-theme .popover {
    background-color: var(--dark-bg-elevated) !important;
    border-color: var(--dark-border) !important;
}

.dark-theme .popover-body {
    color: var(--dark-text-primary) !important;
}

/* Theme Toggle Button Styling */
#themeToggle {
    border: none !important;
    background: none !important;
    color: inherit !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease !important;
}

#themeToggle:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-1px) !important;
}

#themeToggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
    outline: none !important;
}

/* Force Light Theme - Override system dark mode preferences */
/* This ensures the website always uses light theme regardless of browser settings */

/* Override any system dark mode preferences */
* {
    color-scheme: light !important;
}

/* Force body to always use light theme */
body {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Override any dark theme classes that might be applied */
body.dark-theme,
body:not(.light-theme) {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Force all child elements to use light theme */
body * {
    color-scheme: light !important;
}

/* Override any system dark mode media queries */
@media (prefers-color-scheme: dark) {
    body, body * {
        background-color: inherit !important;
        color: inherit !important;
    }
}

/* Ensure all cards maintain light theme */
.card {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.card-header {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom: 1px solid #dee2e6 !important;
}

/* Force light theme for forms */
.form-control, .form-select {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff !important;
    border-color: var(--primary-color) !important;
    color: #212529 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.form-control::placeholder {
    color: #6c757d !important;
}

.input-group-text {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

/* Force light theme for dropdowns */
.dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.dropdown-item {
    color: #212529 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.dropdown-divider {
    border-color: #dee2e6 !important;
}

/* Force light theme for tables */
.table {
    color: #212529 !important;
}

.table thead th {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

.table tbody tr {
    border-color: #dee2e6 !important;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Force light theme for buttons */
.btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
}

.btn-outline-secondary:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

/* Force light theme for text */
.text-muted {
    color: #6c757d !important;
}

.text-dark {
    color: #212529 !important;
}

/* Force light theme for borders */
.border {
    border-color: #dee2e6 !important;
}

/* Force light theme for modals */
.modal-content {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.modal-header {
    border-bottom: 1px solid #dee2e6 !important;
}

.modal-footer {
    border-top: 1px solid #dee2e6 !important;
}

/* Force light theme for list groups */
.list-group-item {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

/* Force light theme for pagination */
.page-link {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.page-link:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Force light theme for progress bars */
.progress {
    background-color: #e9ecef !important;
}

/* Force light theme for chat */
.chat-container {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.chat-messages {
    background-color: #f8f9fa !important;
}

.chat-bubble {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
}

.chat-message.own .chat-bubble {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.chat-input {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

/* Force light theme for alerts */
.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%) !important;
    color: var(--info-color) !important;
    border-left: 4px solid var(--info-color) !important;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%) !important;
    color: #856404 !important;
    border-left: 4px solid var(--warning-color) !important;
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%) !important;
    color: var(--success-color) !important;
    border-left: 4px solid var(--success-color) !important;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%) !important;
    color: var(--danger-color) !important;
    border-left: 4px solid var(--danger-color) !important;
}

/* Force light theme for badges */
.badge {
    color: white !important;
    background-clip: padding-box !important;
}

.badge.bg-light {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    background-clip: padding-box !important;
}

/* Force light theme for tooltips and popovers */
.tooltip-inner {
    background-color: #212529 !important;
    color: #ffffff !important;
}

.popover {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.popover-body {
    color: #212529 !important;
}

/* Force light theme for navigation */
.navbar-dark {
    background-color: #343a40 !important;
}

.navbar-brand, 
.navbar-nav .nav-link {
    color: #ffffff !important;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Ensure stats cards maintain their original styling */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%) !important;
    color: white !important;
}

/* Ensure product cards maintain their original styling */
.product-card {
    background-color: #ffffff !important;
    color: #212529 !important;
    position: relative;
    overflow: visible;
}

/* Fix for product status badges to prevent white overlay */
.product-card .product-status {
    background: transparent !important;
    z-index: 15 !important;
}

.product-card .product-status .badge {
    background-clip: padding-box !important;
    position: relative !important;
    z-index: 16 !important;
}

/* Ensure task cards maintain their original styling */
.task-card {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Ensure media items maintain their original styling */
.media-item {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Simple dropdown fixes */
.dropdown-menu {
    z-index: 1060 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem 0 !important;
    min-width: 160px !important;
    background-color: white !important;
}

.dropdown-item {
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    border-radius: 0 !important;
    border: none !important;
    background: none !important;
    text-align: left !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    color: var(--dark-color) !important;
    text-decoration: none !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: translateX(2px) !important;
    outline: none !important;
}

.dropdown-item:active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.dropdown-toggle {
    cursor: pointer !important;
}

.dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.dropdown-toggle::after {
    margin-left: 0.5rem !important;
}

/* Status buttons styling */
.btn-group-vertical .btn {
    width: 100%;
    text-align: left;
    border-radius: 0.375rem !important;
    margin-bottom: 0.25rem;
}

.btn-group-vertical .btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-group-vertical .btn:not(:disabled):hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Small action buttons styling */
.btn-group-sm .btn {
    min-width: 35px;
    height: 35px;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease;
}

.btn-group-sm .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-group-sm .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Gap between action buttons */
.gap-1 > * + * {
    margin-left: 0.25rem !important;
}

/* Beautiful toast animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Professional status card styles */
.bg-gradient-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
}

.status-btn {
    transition: all 0.3s ease;
    min-height: 60px;
}

.status-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.status-btn .fas, .status-btn .fab {
    font-size: 1.2rem;
}

.status-btn small {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Supplier and reference link styles */
.supplier-link, .reference-link {
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.supplier-link:hover, .reference-link:hover {
    background-color: #f8f9fa;
}

/* Links management styles */
#editLinksForm .form-label {
    font-weight: 600;
    color: #495057;
}

#editLinksForm .form-control:focus {
    border-color: #17a2b8;
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

.btn-outline-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline-secondary:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Media card styles */
.media-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.media-preview-container {
    overflow: hidden;
}

.media-preview-container .btn-group-vertical {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-card:hover .btn-group-vertical {
    opacity: 1;
}

.clickable-media {
    transition: all 0.3s ease;
}

.clickable-media:hover {
    transform: scale(1.05);
}

.media-expand-btn, .media-delete-btn {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

/* Gallery navigation styles */
.gallery-nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.gallery-nav-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 1) !important;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Media gallery modal */
#mediaGalleryModal .modal-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

#mediaGalleryModal img {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#mediaGalleryModal video {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Badge counter */
#mediaGalleryModal .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Keyboard hint */
.keyboard-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Chat styles */
.chat-container {
    background: #fff;
}

.chat-messages {
    background: #f8f9fa;
}

.chat-message {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.max-width-75 {
    max-width: 75%;
}

.chat-input {
    background: #fff;
    border-top: 1px solid #dee2e6;
}

.chat-input .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#chatInput {
    border-right: none;
}

#chatSendBtn {
    border-left: none;
}

/* Message bubbles */
.bg-primary.rounded {
    border-radius: 1rem !important;
}

.bg-light.rounded {
    border-radius: 1rem !important;
    border: 1px solid #dee2e6;
}

/* Modern Chat Styles */
.chat-messages-modern {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.chat-messages-modern::-webkit-scrollbar {
    width: 4px;
}

.chat-messages-modern::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-modern::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.chat-messages-modern::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.chat-message-modern {
    animation: slideInUp 0.2s ease-out;
    transition: all 0.2s ease;
}

.chat-message-modern:hover {
    transform: translateY(-1px);
}

.chat-bubble-modern {
    position: relative;
    word-wrap: break-word;
    transition: all 0.2s ease;
}

.chat-bubble-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* Chat textarea styles */
.chat-input-modern textarea {
    line-height: 1.4;
    min-height: 32px;
    max-height: 100px;
    transition: height 0.2s ease;
}

.message-meta {
    transition: opacity 0.2s ease;
}

.chat-bubble-modern:hover .message-meta {
    opacity: 1 !important;
}

.chat-input-modern .form-control:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    border-color: transparent !important;
}

.chat-input-modern .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.empty-chat-icon {
    animation: pulse 2s infinite;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Responsive chat */
@media (max-width: 768px) {
    .chat-bubble-modern {
        font-size: 0.8rem !important;
        padding: 8px 12px !important;
    }
    
    .message-header {
        font-size: 0.7rem !important;
    }
    
    .message-time {
        font-size: 0.6rem !important;
    }
    
    .chat-input-modern textarea {
        font-size: 0.875rem;
    }
}

/* Scroll styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.custom-toast {
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Modal fixes */
.modal {
    z-index: 1070 !important;
}

.modal-backdrop {
    z-index: 1065 !important;
}

/* Enhanced Mobile Navigation */
.navbar-toggler {
    padding: 0.25rem 0.5rem;
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-brand {
    font-weight: 700;
}

/* Fix navbar text alignment - Desktop priority */
.navbar-nav .nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    line-height: 1 !important;
    min-height: 48px !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
}

.navbar-nav .nav-link i {
    width: 20px !important;
    height: 20px !important;
    text-align: center !important;
    font-size: 1rem !important;
    line-height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 0.5rem !important;
    flex-shrink: 0 !important;
}

.navbar-nav .nav-link span {
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: visible !important;
}

/* Navbar brand alignment */
.navbar-brand {
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
}

.navbar-brand i {
    width: 24px !important;
    height: 24px !important;
    font-size: 1.25rem !important;
    line-height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 0.5rem !important;
    flex-shrink: 0 !important;
}

.navbar-brand span {
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: visible !important;
}

/* Dropdown items alignment */
.dropdown-item {
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
    padding: 0.5rem 1rem !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
}

.dropdown-item i {
    width: 20px !important;
    height: 20px !important;
    text-align: center !important;
    font-size: 1rem !important;
    line-height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 0.5rem !important;
    flex-shrink: 0 !important;
}

.dropdown-item span {
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: visible !important;
}

/* Sticky navigation improvements */
.sticky-top {
    z-index: 1020;
}

/* Font Awesome icon baseline fix for navbar */
.navbar-nav .nav-link i.fas,
.navbar-nav .nav-link i.far,
.navbar-nav .nav-link i.fab {
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    vertical-align: baseline !important;
}

.navbar-brand i.fas,
.navbar-brand i.far,
.navbar-brand i.fab {
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    vertical-align: baseline !important;
}

.dropdown-item i.fas,
.dropdown-item i.far,
.dropdown-item i.fab {
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    vertical-align: baseline !important;
}

/* Override Bootstrap navbar defaults that might cause misalignment */
.navbar-nav .nav-link {
    position: relative !important;
}

.navbar-nav .nav-link::before,
.navbar-nav .nav-link::after {
    display: none !important;
}

/* Prevent text wrapping in navbar - Global fix */
.navbar * {
    word-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

.navbar .nav-link,
.navbar .navbar-brand,
.navbar .dropdown-item {
    white-space: nowrap !important;
    text-wrap: nowrap !important;
    overflow-wrap: normal !important;
}

/* Extra safety for Vietnamese text */
.navbar .nav-link span,
.navbar .navbar-brand span,
.navbar .dropdown-item span {
    word-spacing: normal !important;
    letter-spacing: normal !important;
    text-align: left !important;
    direction: ltr !important;
}

/* Mobile-first utilities */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .text-truncate-mobile {
        max-width: 150px;
    }
}

/* Responsive spacing utilities */
.p-mobile {
    padding: 0.5rem !important;
}

.px-mobile {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.py-mobile {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.m-mobile {
    margin: 0.5rem !important;
}

.mx-mobile {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
}

.my-mobile {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Responsive flex utilities */
.flex-column-mobile {
    flex-direction: column !important;
}

.flex-row-mobile {
    flex-direction: row !important;
}

.justify-content-center-mobile {
    justify-content: center !important;
}

.align-items-center-mobile {
    align-items: center !important;
}

/* Touch-friendly button sizes */
.btn-touch {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Fix for button text white overlay issues */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%) !important;
    border: none !important;
    color: white !important;
    position: relative !important;
    z-index: 10 !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

.btn-primary i,
.btn-primary span {
    color: white !important;
    position: relative !important;
    z-index: 11 !important;
    background: transparent !important;
}

/* Card enhancements for mobile */
.card-mobile {
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-mobile:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* Form enhancements */
.form-floating-mobile .form-control {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating-mobile label {
    padding: 1rem 0.75rem;
}

/* Table alternatives for mobile */
.list-group-mobile .list-group-item {
    border: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.border-radius-lg {
    border-radius: 1rem;
}

.transition-all {
    transition: all 0.3s ease;
}

/* Responsive utilities */
.d-mobile-none {
    display: none !important;
}

.d-mobile-block {
    display: block !important;
}

.d-mobile-flex {
    display: flex !important;
}

@media (min-width: 768px) {
    .d-mobile-none {
        display: block !important;
    }
    
    .d-mobile-block {
        display: none !important;
    }
    
    .d-mobile-flex {
        display: none !important;
    }
}

/* Position fixes */
.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

/* Fix for white overlay issues on badges and status elements */
.badge, .product-status, .status-badge {
    background-clip: padding-box !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Prevent white background from interfering with colored elements */
.badge.bg-primary,
.badge.bg-success,
.badge.bg-warning,
.badge.bg-info,
.badge.bg-danger,
.badge.bg-secondary {
    background-clip: padding-box !important;
    position: relative !important;
    z-index: 11 !important;
}

/* Ensure product status badges are always visible */
.product-card .badge {
    background-clip: padding-box !important;
    position: relative !important;
    z-index: 12 !important;
}

/* Fix for all text and icon white overlay issues */
.btn i,
.btn span,
.btn small,
.btn .fas,
.btn .far,
.btn .fab {
    color: inherit !important;
    background: transparent !important;
    position: relative !important;
    z-index: 11 !important;
}

/* Specific fix for primary buttons */
.btn-primary i,
.btn-primary span,
.btn-primary small,
.btn-primary .fas,
.btn-primary .far,
.btn-primary .fab {
    color: white !important;
    background: transparent !important;
    position: relative !important;
    z-index: 11 !important;
}

/* Fix for all button text elements */
.btn * {
    color: inherit !important;
    background: transparent !important;
    position: relative !important;
    z-index: 11 !important;
}

/* Ultimate fix for white overlay issues */
.btn,
.btn *,
.badge,
.badge *,
.product-status,
.product-status * {
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
    position: relative !important;
    z-index: 15 !important;
}

/* Force text visibility */
.btn span,
.btn i,
.btn small,
.badge span,
.badge i,
.product-status span,
.product-status i {
    color: inherit !important;
    background: transparent !important;
    text-shadow: none !important;
    box-shadow: none !important;
    position: relative !important;
    z-index: 20 !important;
}

/* Overflow fixes for containers */
.table-responsive {
    overflow: visible !important;
}

.card-body {
    overflow: visible !important;
}

.card {
    overflow: visible !important;
}

.container {
    overflow: visible !important;
}

/* Advanced Responsive Enhancements */

/* Smooth transitions for all responsive changes */
* {
    transition: padding 0.3s ease, margin 0.3s ease, font-size 0.3s ease;
}

/* Improved focus states for mobile */
@media (max-width: 768px) {
    .form-control:focus,
    .form-select:focus {
        transform: scale(1.02);
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }
    
    /* Better button states for touch */
    .btn:active {
        transform: scale(0.98);
    }
    
    /* Improved dropdown for mobile */
    .dropdown-menu {
        border-radius: 1rem;
        border: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        animation: slideDown 0.2s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Mobile-optimized pagination */
    .pagination {
        justify-content: center;
    }
    
    .pagination .page-item:not(.active):not(.disabled) .page-link {
        display: none;
    }
    
    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link,
    .pagination .page-item.active .page-link {
        display: block;
    }
    
    /* Show only prev/next and current page on mobile */
    .pagination .page-item:nth-child(-n+2) .page-link,
    .pagination .page-item:nth-last-child(-n+2) .page-link,
    .pagination .page-item.active ~ .page-item:first-of-type .page-link,
    .pagination .page-item.active .page-link {
        display: block;
    }
}

/* Enhanced accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .form-control,
    .form-select {
        border: 2px solid var(--dark-color);
    }
}

/* Landscape mobile optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .modal-dialog {
        margin: 0.25rem;
    }
}

/* PWA and mobile app optimizations */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .navbar {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }
}

/* Clean slate - let Bootstrap work normally */
.dropdown-divider {
    margin: 0.5rem 0 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Final responsive polish */
@media (max-width: 576px) {
    /* Ensure all interactive elements are touch-friendly */
    .btn,
    .form-control,
    .form-select,
    .dropdown-toggle {
        min-height: 44px;
    }
    
    /* Optimize spacing for small screens */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Stack elements vertically on very small screens */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .d-flex.gap-2 > *,
    .d-flex.gap-3 > * {
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-2 > *:last-child,
    .d-flex.gap-3 > *:last-child {
        margin-bottom: 0;
    }
}

/* Loading indicator cho AJAX pagination */
#media-loading {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin: 1rem 0;
    backdrop-filter: blur(5px);
}

#media-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

#media-loading p {
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

/* Smooth transition cho media gallery */
#media-gallery {
    transition: opacity 0.3s ease-in-out;
}

#media-gallery.loading {
    opacity: 0.5;
}

/* Pagination improvements */
.pagination .page-link {
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    color: #0d6efd;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}