/**
 * BX Connect Dealer Panel - Global Style Sheets
 * Implements a premium, high-end neon purple glassmorphism design system.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ==========================================
   CSS CUSTOM VARIABLES (DESIGN SYSTEM)
   ========================================== */
:root {
  --bg-primary: #09090b;
  --bg-secondary: #0b0a16;
  --bg-tertiary: #131224;
  --accent-purple: #a855f7;
  --accent-blue: #6366f1;
  --accent-cyan: #06b6d4;
  --text-white: #ffffff;
  --text-muted: #a1a1aa;
  --text-dark: #71717a;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(168, 85, 247, 0.25);
  
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-blur: blur(12px);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 20px rgba(168, 85, 247, 0.15);
  --shadow-glow-strong: 0 0 30px rgba(168, 85, 247, 0.35);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-muted);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, .font-outfit {
  font-family: 'Outfit', sans-serif;
  color: var(--text-white);
  font-weight: 600;
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* ==========================================
   GLASSMORPHISM & PREMIUM UTILITIES
   ========================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}
.glass-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.bg-dark-glass {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.text-purple { color: var(--accent-purple) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-white { color: var(--text-white) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.font-mono { font-family: 'Courier New', Courier, monospace !important; }

.hover-glow:hover {
  text-shadow: 0 0 8px var(--accent-purple);
}

.cursor-pointer { cursor: pointer; }

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 0.5rem;
  text-decoration: none;
}

.btn-purple {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}
.btn-purple:hover {
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
  transform: translateY(-1px);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-light);
  color: var(--text-white);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline-success {
  background: rgba(16, 185, 129, 0.03);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}
.btn-outline-success:hover {
  background: var(--success);
  color: var(--bg-primary);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-outline-danger {
  background: rgba(239, 68, 68, 0.03);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: var(--text-white);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.btn-outline-warning {
  background: rgba(245, 158, 11, 0.03);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}
.btn-outline-warning:hover {
  background: var(--warning);
  color: var(--bg-primary);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-icon:hover {
  transform: scale(1.15);
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-processing {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.badge-success-dot { background-color: var(--success); }
.badge-danger-dot { background-color: var(--danger); }
.badge-warning-dot { background-color: var(--warning); }
.badge-info-dot { background-color: var(--info); }

/* ==========================================
   FORM CONTROLS
   ========================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-white);
  margin-bottom: 0.5rem;
}

.form-control, select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-white);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.form-control:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

select option {
  background: var(--bg-tertiary);
  color: var(--text-white);
}

/* ==========================================
   LAYOUT STRUCTURE (SIDEBAR + MAIN)
   ========================================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background: rgba(11, 10, 22, 0.95);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition-smooth);
}

.sidebar-logo {
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-white);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--text-white) 30%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  list-style: none;
  padding: 1.5rem 0.75rem;
  flex-grow: 1;
}

.menu-item {
  margin-bottom: 0.35rem;
}

.menu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: var(--transition-smooth);
  gap: 0.75rem;
}

.menu-link i {
  font-size: 1.1rem;
  opacity: 0.7;
}

.menu-link:hover {
  background: rgba(168, 85, 247, 0.05);
  color: var(--text-white);
  padding-left: 1.25rem;
}

.menu-item.active .menu-link {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.08);
}

.menu-item.active .menu-link i {
  color: var(--accent-purple);
  opacity: 1;
}

.sidebar-profile {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-white);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.avatar-lg {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.sidebar-profile-info {
  overflow: hidden;
}

.sidebar-profile-info h5 {
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
  text-truncate: true;
}

.sidebar-profile-info span {
  font-size: 0.75rem;
  color: var(--text-dark);
  display: block;
}

/* Main Content Layout */
.main-content {
  margin-left: 260px;
  flex-grow: 1;
  padding: 2rem 2.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Navbar */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.navbar-page-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.notification-bell {
  position: relative;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.notification-bell:hover {
  color: var(--text-white);
  transform: scale(1.1);
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent-purple);
  color: var(--text-white);
  font-size: 0.6rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1px solid var(--bg-primary);
}

/* ==========================================
   TABLES
   ========================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.premium-table th {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.2);
}

.premium-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  color: var(--text-muted);
  vertical-align: middle;
}

.premium-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-white);
}

/* ==========================================
   MODALS
   ========================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 600px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(-30px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal.active .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.modal-close:hover {
  color: var(--text-white);
  transform: scale(1.1);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-close:focus {
  outline: none;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
}

.toast {
  background: rgba(11, 10, 22, 0.9);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 320px;
  max-width: 450px;
  color: var(--text-white);
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-content {
  font-size: 0.8rem;
  font-weight: 500;
  flex-grow: 1;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.toast-success {
  border-left: 4px solid var(--success);
}
.toast-success .toast-icon { color: var(--success); }

.toast-error {
  border-left: 4px solid var(--danger);
}
.toast-error .toast-icon { color: var(--danger); }

.toast-warning {
  border-left: 4px solid var(--warning);
}
.toast-warning .toast-icon { color: var(--warning); }

.toast-info {
  border-left: 4px solid var(--info);
}
.toast-info .toast-icon { color: var(--info); }

/* Mobile sidebar overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================
   CSS ANIMATIONS
   ========================================== */
.fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-out {
  animation: slideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}

/* Hamburger mobile button */
#sidebar-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
}
#sidebar-close-btn {
  display: none;
}
.text-center { text-align: center !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-auto { margin-top: auto !important; }
.pt-2 { padding-top: 0.5rem !important; }
.border-top { border-top: 1px solid var(--border-light) !important; }
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-column { flex-direction: column !important; }
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rounded { border-radius: 8px !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.border { border: 1px solid var(--border-light) !important; }
.border-light { border-color: var(--border-light) !important; }
.btn-block { width: 100%; }
.bg-purple-glow {
  background: var(--accent-purple);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}
.w-100 { width: 100% !important; }
.text-end { text-align: right !important; }

/* ==========================================
   GRID LAYOUT COLUMNS UTILITY SYSTEM
   ========================================== */
.row { 
  display: flex !important; 
  flex-wrap: wrap !important; 
  margin-right: -15px !important; 
  margin-left: -15px !important; 
}

[class*="col-"] {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-sm-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-sm-6 { flex: 0 0 50%; max-width: 50%; }
.col-sm-7 { flex: 0 0 58.333%; max-width: 58.333%; }

.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; }

.col-lg-3 { flex: 0 0 25%; max-width: 25%; }
.col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }

.col-12 { flex: 0 0 100%; max-width: 100%; }
