/* buyer/dashboard.css */

/* Dashboard Overview */
.welcome-card {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
}

.welcome-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.welcome-card p {
  opacity: 0.9;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.welcome-stats {
  display: flex;
  gap: 1.5rem;
}

.welcome-stats div {
  display: flex;
  flex-direction: column;
}

.welcome-stats .stat {
  font-size: 1.2rem;
  font-weight: 700;
}

.welcome-stats .label {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quick-action-card {
  background: var(--lighter);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.quick-action-card i {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.quick-action-card span {
  font-size: 0.8rem;
  font-weight: 500;
  display: block;
}

.quick-action-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Order List */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-item {
  background: var(--lighter);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
}

.order-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.order-seller {
  font-weight: 600;
  font-size: 0.9rem;
}

.order-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.order-title {
  font-weight: 500;
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.order-amount {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.order-progress {
  margin: 0.5rem 0;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-muted);
}

.progress-step {
  text-align: center;
  flex: 1;
}

.progress-step.active {
  color: var(--primary);
  font-weight: 600;
}

.order-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Order Details View */
.order-detail-card {
  background: var(--lighter);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.detail-row {
  display: flex;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.detail-label {
  width: 100px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-value {
  flex: 1;
  font-weight: 500;
}

.tracking-info {
  background: var(--light);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  margin: 1rem 0;
}

.tracking-number {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

/* Confirmation Modal */
.confirm-box {
  text-align: center;
  padding: 1.5rem;
}

.confirm-box i {
  font-size: 4rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.confirm-box h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.confirm-box p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
}

/* Empty States */
.empty-orders {
  text-align: center;
  padding: 2rem 1rem;
}

.empty-orders i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-orders p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
  
  .order-actions {
    flex-wrap: wrap;
  }
  
  .order-actions .btn {
    flex: 1;
    min-width: 120px;
  }
  
  .confirm-actions {
    flex-direction: column;
  }
}

/* ===========================================
   DESKTOP VIEW FIXES - ADD AT THE BOTTOM
   =========================================== */

@media (min-width: 768px) {
  .dashboard {
    flex-direction: row;
  }
  
  .mobile-header {
    display: none !important;
  }
  
  .sidebar {
    left: 0 !important;
    width: var(--sidebar-width, 260px);
    position: fixed;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
  }
  
  .main-content {
    margin-left: var(--sidebar-width, 260px);
    width: calc(100% - var(--sidebar-width, 260px));
    padding: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
  
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .order-card {
    margin-bottom: 0;
  }
  
  .order-actions {
    flex-direction: row;
  }
  
  .order-actions .btn {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 2.5rem;
  }
  
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-grid {
    gap: 2rem;
  }
}

/* Fix for any overflowing content */
* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

.main-content {
  background: var(--light);
  min-height: 100vh;
}


/* User ID Container */
.user-id-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Copy Button */
.copy-id-btn {
  position: relative;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: white;
  width: 28px;
  height: 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(16, 185, 129, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
}

.copy-id-btn i {
  font-size: 14px;
  transition: all 0.3s ease;
}

.copy-id-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.copy-id-btn:active {
  transform: scale(0.95);
}

.copy-id-btn.copied {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.copy-id-btn.copied i {
  animation: copyPop 0.3s ease;
}

/* Tooltip */
.copy-tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  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: #1f2937;
}

.copy-id-btn:hover .copy-tooltip {
  opacity: 1;
  visibility: visible;
  top: -35px;
}

/* Animation for copy success */
@keyframes copyPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .copy-id-btn {
    width: 32px;
    height: 32px;
  }
  
  .copy-id-btn i {
    font-size: 16px;
  }
  
  .copy-tooltip {
    display: none; /* Hide tooltip on mobile */
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .copy-tooltip {
    background: #374151;
  }
  
  .copy-tooltip::after {
    background: #374151;
  }
}



/* User Info Container - Clean 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;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* Avatar - Using brand color gradient (adjust these colors to match your logo) */
.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, #667eea, #764ba2); /* Purple gradient - adjust to your brand */
  color: white;
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

/* User Details Container */
.user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* User Name - Professional dark color */
.user-details h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
}

/* User Email - Brand color for consistency */
.user-details p {
  margin: 0;
  font-size: 0.75rem;
  color: #667eea !important; /* Brand purple - change to your logo color */
  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 - Light brand color background */
.user-badge {
  background: #f0f4ff; /* Light purple background */
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #4a5568 !important;
  letter-spacing: 0.3px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  display: inline-block;
  flex-shrink: 1;
}

/* Copy Button - Brand color gradient */
.copy-id-btn {
  position: relative;
  background: linear-gradient(135deg, #667eea, #764ba2); /* Brand gradient */
  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(102, 126, 234, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  flex-shrink: 0;
}

.copy-id-btn:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46a1); /* Darker brand gradient */
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.copy-id-btn:active {
  transform: scale(0.95);
}

.copy-id-btn.copied {
  background: linear-gradient(135deg, #48bb78, #38a169); /* Green when copied */
}

/* Tooltip */
.copy-tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  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.15);
}

.copy-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #2d3748;
}

.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;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.25);
  }
  
  .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;
  }
}

/* Optional: Add subtle animation for brand feel */
@keyframes brandPulse {
  0% {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
  }
  100% {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }
}

.copy-id-btn:not(:hover) {
  animation: brandPulse 2s infinite;
}