/* css/dashboard-shared.css */
:root {
  --primary: #6C63FF;
  --primary-dark: #5a52d4;
  --primary-light: #8f88ff;
  --secondary: #FF6584;
  --secondary-dark: #e05572;
  --accent: #2ecc71;
  --accent-dark: #27ae60;
  
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 60px;
  
  --dark: #0f0f1a;
  --darker: #080812;
  --light: #f8faff;
  --lighter: #ffffff;
  --text: #1a1a2e;
  --text-light: #4a4a6a;
  --text-muted: #6b6b8b;
  --gray: #e1e5f0;
  --gray-dark: #2d2d44;
  --border: #eef2f6;
  --error: #ff4757;
  --success: #2ecc71;
  --warning: #ffa502;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --border-radius: 16px;
  --border-radius-sm: 12px;
}

.dark-mode {
  --primary: #8f88ff;
  --primary-dark: #6C63FF;
  --secondary: #ff8fa3;
  --secondary-dark: #FF6584;
  --dark: #f8faff;
  --darker: #ffffff;
  --light: #12121a;
  --lighter: #1a1a26;
  --text: #f0f0f5;
  --text-light: #b0b0c0;
  --text-muted: #8a8aa0;
  --gray: #2a2a3a;
  --border: #2a2a3a;
}

/* Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--light);
  color: var(--text);
  overflow-x: hidden;
}

/* Dashboard Layout - Mobile First */
.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Mobile Header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--lighter);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
}

.mobile-logo {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mobile-profile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Sidebar - Mobile (hidden by default) */
.sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: var(--lighter);
  border-right: 1px solid var(--border);
  transition: left 0.3s ease;
  z-index: 1000;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.close-sidebar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}

/* User Info in Sidebar */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--light);
  border-radius: var(--border-radius-sm);
  margin-bottom: 2rem;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
}

.user-details h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.user-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.3rem;
}

/* Navigation */
.sidebar-nav {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.nav-link i {
  width: 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.nav-link:hover {
  background: var(--light);
}

.nav-link.active {
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary);
}

.nav-link.active i {
  color: var(--primary);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-top: var(--header-height);
  padding: 1rem;
  width: 100%;
  overflow-x: hidden;
}

/* Page Header */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--lighter);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-change {
  font-size: 0.7rem;
  color: var(--success);
  margin-top: 0.3rem;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.section-header .action-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Order Card */
.order-card {
  background: var(--lighter);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  transition: all 0.2s;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.order-id {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  font-family: monospace;
}

.order-status {
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pending {
  background: rgba(255, 165, 2, 0.1);
  color: var(--warning);
}

.status-paid {
  background: rgba(46, 204, 113, 0.1);
  color: var(--success);
}

.status-shipped {
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary);
}

.status-delivered {
  background: rgba(46, 204, 113, 0.1);
  color: var(--success);
}

.status-disputed {
  background: rgba(255, 71, 87, 0.1);
  color: var(--error);
}

.order-details {
  margin-bottom: 0.8rem;
}

.order-item {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.order-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.order-meta i {
  margin-right: 0.2rem;
}

.order-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Buttons - Smaller for mobile */
.btn {
  padding: 0.6rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-primary, #FF8A5C);
  color: white;
}

.btn-primary:hover {
  background: var(--btn-primary-hover, #ff6b3d);
}

.btn-secondary {
  background: var(--btn-secondary, #4ECDC4);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--lighter);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* File Upload */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}

.upload-area:hover {
  border-color: var(--primary);
  background: rgba(108, 99, 255, 0.05);
}

.upload-area i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.upload-area p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.preview-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--light);
  border-radius: var(--border-radius-sm);
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Alerts */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

.alert-warning {
  background: rgba(255, 165, 2, 0.1);
  border: 1px solid var(--warning);
  color: var(--warning);
}

/* Loading */
.loading-spinner {
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Desktop Styles */
@media (min-width: 768px) {
  .mobile-header {
    display: none;
  }
  
  .dashboard {
    flex-direction: row;
  }
  
  .sidebar {
    position: sticky;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
  }
  
  .main-content {
    margin-top: 0;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    width: calc(100% - var(--sidebar-width));
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}



/* User Info Container - White background */
.user-info {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: white; /* Pure white background */
  border-bottom: 1px solid #e5e7eb; /* Light gray border for separation */
}

/* Avatar - Fixed size, never moves */
.user-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e293b, #0f172a); /* Dark gray gradient */
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* User Details Container - Takes remaining space */
.user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* User Name - Dark color for white background */
.user-details h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b; /* Dark slate */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
}

/* User Email - Professional blue color */
.user-details p {
  margin: 0;
  font-size: 0.75rem;
  color: #3b82f6 !important; /* Bright blue */
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  width: 100%;
}

/* User ID Container */
.user-id-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  min-width: 0;
}

/* User Badge - Professional style */
.user-badge {
  background: #f1f5f9; /* Light gray background */
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #1e293b !important; /* Dark slate */
  letter-spacing: 0.3px;
  border: 1px solid #e2e8f0; /* Light gray border */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  display: inline-block;
  flex-shrink: 1;
}

/* Copy Button - Professional blue to match email */
.copy-id-btn {
  position: relative;
  background: #3b82f6; /* Bright blue */
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  flex-shrink: 0;
}

.copy-id-btn:hover {
  background: #2563eb; /* Darker blue */
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.copy-id-btn:active {
  transform: scale(0.95);
}

.copy-id-btn.copied {
  background: #10b981; /* Green when copied */
}

/* Tooltip for copy button */
.copy-tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.copy-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #1e293b;
}

.copy-id-btn:hover .copy-tooltip {
  opacity: 1;
  visibility: visible;
  top: -35px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .user-info {
    padding: 16px 12px;
    gap: 10px;
  }
  
  .user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 1rem;
  }
  
  .user-details h4 {
    font-size: 0.9rem;
  }
  
  .user-details p {
    font-size: 0.7rem;
  }
  
  .user-badge {
    max-width: 80px;
    font-size: 0.65rem;
    padding: 3px 6px;
  }
  
  .copy-id-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }
  
  .copy-id-btn i {
    font-size: 12px;
  }
}

/* Small screens */
@media (max-width: 480px) {
  .user-info {
    padding: 12px 10px;
    gap: 8px;
  }
  
  .user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  
  .user-details h4 {
    font-size: 0.85rem;
  }
  
  .user-details p {
    font-size: 0.65rem;
  }
  
  .user-badge {
    max-width: 70px;
  }
}