/* ===================================================
   ELFIT ARABIA B2B PORTAL - PROFESSIONAL THEME
   Modern, Clean, Enterprise-Grade Design
   =================================================== */

/* CSS Custom Properties (Design Tokens) */
:root {
    /* Primary Palette - Deep Blue Professional */
    --primary-900: #0f172a;
    --primary-800: #1e293b;
    --primary-700: #334155;
    --primary-600: #475569;
    --primary-500: #64748b;

    /* Accent Colors - Royal Blue */
    --accent-600: #2563eb;
    --accent-500: #3b82f6;
    --accent-400: #60a5fa;
    --accent-300: #93c5fd;

    /* Surface Colors */
    --surface-dark: #0f172a;
    --surface-card: #1e293b;
    --surface-elevated: #334155;
    --surface-border: #475569;

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-accent: #60a5fa;

    /* Status Colors */
    --success: #22c55e;
    --success-hover: #16a34a;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --info: #06b6d4;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Global Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--surface-dark) 0%, var(--primary-800) 50%, var(--surface-dark) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

/* ===================================================
   SIDEBAR NAVIGATION
   =================================================== */
.sidebar {
    height: 100vh;
    width: 280px;
    position: fixed;
    top: 0;
    left: -280px;
    background: linear-gradient(180deg, var(--primary-800) 0%, var(--surface-dark) 100%);
    transition: left var(--transition-normal);
    padding-top: 100px;
    z-index: 1000;
    border-right: 1px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
}

.sidebar.active {
    left: 0;
}

.sidebar-toggle {
    position: fixed;
    top: 80px;
    left: 10px;
    z-index: 1100;
    background: linear-gradient(135deg, var(--accent-600) 0%, var(--accent-500) 100%);
    border: none;
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-400) 100%);
    transform: scale(1.05);
}

.sidebar a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
    border-left-color: var(--accent-500);
    padding-left: 36px;
}

.sidebar a.active {
    color: var(--accent-400);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
    border-left-color: var(--accent-400);
}

/* ===================================================
   TOP NAVIGATION BAR
   =================================================== */
.navbar {
    background: linear-gradient(180deg, var(--primary-800) 0%, var(--surface-dark) 100%);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--surface-border);
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-400) 0%, var(--accent-300) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent-400) !important;
    background-color: rgba(59, 130, 246, 0.1);
    border-bottom: 2px solid var(--accent-400);
}

/* ===================================================
   FORM ELEMENTS
   =================================================== */
.form-control {
    background-color: var(--surface-card);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    background-color: var(--surface-elevated);
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    background-color: var(--surface-card);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: all var(--transition-fast);
}

.form-select:focus {
    background-color: var(--surface-elevated);
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-600) 0%, var(--accent-500) 100%);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-400) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-hover) 100%);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-hover) 100%);
    color: var(--primary-900);
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-info:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-outline-light {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-500);
    color: var(--text-primary);
}

/* ===================================================
   TABLES
   =================================================== */
.table-dark {
    background-color: var(--surface-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-dark th {
    background-color: var(--surface-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 16px;
    border-color: var(--surface-border);
}

.table-dark td {
    padding: 14px 16px;
    border-color: var(--surface-border);
    color: var(--text-primary);
    vertical-align: middle;
}

.table-dark tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* ===================================================
   ALERTS & NOTIFICATIONS  
   =================================================== */
.alert {
    background-color: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-left: 4px solid var(--accent-500);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
}

.alert-success {
    border-left-color: var(--success);
    background-color: rgba(34, 197, 94, 0.1);
}

.alert-warning {
    border-left-color: var(--warning);
    background-color: rgba(245, 158, 11, 0.1);
}

.alert-danger {
    border-left-color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
}

.alert-info {
    border-left-color: var(--info);
    background-color: rgba(6, 182, 212, 0.1);
}

/* ===================================================
   MODALS
   =================================================== */
.modal-content {
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--primary-800) 100%);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--surface-border);
    padding: 20px 24px;
}

.modal-header .modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--surface-border);
    padding: 16px 24px;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ===================================================
   PRODUCT CATEGORIES
   =================================================== */
.product-categories {
    max-width: 100%;
}

.product-category {
    background: linear-gradient(145deg, var(--surface-card) 0%, var(--primary-800) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    margin-bottom: 16px;
}

.product-category:hover {
    border-color: var(--accent-500);
    box-shadow: var(--shadow-glow);
}

.category-header {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-card) 100%);
    padding: 24px 28px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.category-header:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--surface-elevated) 100%);
}

.category-header h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.category-arrow {
    color: var(--accent-400);
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.category-header[aria-expanded="true"] .category-arrow {
    transform: rotate(180deg);
}

.category-content {
    background-color: var(--surface-dark);
}

.category-body {
    padding: 28px;
    border-top: 1px solid rgba(71, 85, 105, 0.2);
}

.category-body p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 16px;
    font-style: italic;
}

.category-header[aria-expanded="false"]:hover h4 {
    color: var(--accent-300);
}

/* ===================================================
   PRODUCT OPTIONS
   =================================================== */
.product-option {
    background: linear-gradient(145deg, var(--surface-card) 0%, var(--surface-elevated) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.product-option:hover {
    border-color: var(--accent-500);
}

.remove-option {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.remove-option:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.add-option {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-hover) 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.add-option:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* ===================================================
   BADGES
   =================================================== */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--accent-600) 0%, var(--accent-500) 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-hover) 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-hover) 100%) !important;
    color: var(--primary-900);
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%) !important;
}

/* Subtle pulse animation for notification badges */
.badge-notification {
    animation: subtlePulse 2.5s ease-in-out infinite;
}

@keyframes subtlePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 8px 2px rgba(59, 130, 246, 0.2);
    }
}

/* ===================================================
   LIST GROUP ITEMS (Orders, Messages, etc.)
   =================================================== */
.list-group-item {
    background: linear-gradient(145deg, var(--surface-card) 0%, var(--surface-elevated) 100%);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md) !important;
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.list-group-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-500);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.list-group-item h4,
.list-group-item h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.list-group-item small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.list-group-item p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Buttons inside list items */
.list-group-item .btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

/* Images in list items */
.list-group-item img {
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    background-color: var(--surface-card);
    margin-top: 12px;
    transition: all var(--transition-fast);
}

.list-group-item img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

/* ===================================================
   CARDS
   =================================================== */
.card {
    background: linear-gradient(145deg, var(--surface-card) 0%, var(--primary-800) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    border-color: var(--accent-500);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-3px);
}

.card-header {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-card) 100%);
    border-bottom: 1px solid var(--surface-border);
    padding: 20px 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--surface-border);
    padding: 16px 24px;
}

.card-title {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.card-title a {
    color: var(--accent-400);
}

/* ===================================================
   SECTION HEADINGS
   =================================================== */
.section h2 {
    color: var(--text-primary);
    font-weight: 700;
    border-bottom: 3px solid var(--accent-500);
    padding-bottom: 12px;
    margin-bottom: 24px;
    display: inline-block;
}

/* ===================================================
   LIST GROUP CONTAINER
   =================================================== */
.list-group {
    border-radius: var(--radius-lg);
    gap: 0;
}

/* ===================================================
   UTILITY CLASSES
   =================================================== */
.text-muted {
    color: var(--text-muted) !important;
}

.text-accent {
    color: var(--accent-400) !important;
}

.bg-surface {
    background-color: var(--surface-card);
}

/* ===================================================
   SCROLLBAR STYLING
   =================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}

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

    .sidebar.active {
        left: 0;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.4rem;
    }

    .list-group-item {
        padding: 16px;
    }

    .card-body {
        padding: 16px;
    }
}

/* ===================================================
   LOADING STATES
   =================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--surface-card) 25%, var(--surface-elevated) 50%, var(--surface-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===================================================
   FOCUS STATES (Accessibility)
   =================================================== */
*:focus-visible {
    outline: 2px solid var(--accent-400);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}