/**
 * dashboard.css - Admin Dashboard Styles
 * Styles for the founder admin dashboard including analytics cards, orders table, and navigation
 */

/* ============================================================================
   Reset and Base Styles
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
  background-color: #1a1a2e !important;
  min-height: 100vh;
  font-family: 'Lora', serif;
  transition: none !important;
}

body.menu-open {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
  background-color: #1a1a2e !important;
  transition: none !important;
}

/* ============================================================================
   Header Styling
   ============================================================================ */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  padding: 1rem 2rem;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.05);
}

.back-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.orobor-logo-white {
  height: 40px;
  filter: brightness(0) invert(1) drop-shadow(0 2px 2px rgba(0,0,0,0.35)) drop-shadow(0 6px 12px rgba(0,0,0,0.2));
}

.desktop-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.desktop-nav a {
  color: white !important;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.desktop-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-signIn {
  background: linear-gradient(135deg, #3498db, #2980b9) !important;
  color: white !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 25px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  border: none !important;
  cursor: pointer;
}

.btn-signIn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3) !important;
}

/* ============================================================================
   Dashboard Content
   ============================================================================ */

.dashboard-container {
  margin-top: 100px;
  padding: 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================================
   Analytics Cards
   ============================================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.card-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: white;
}

.card-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* ============================================================================
   Orders Section
   ============================================================================ */

.orders-section {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.section-controls input,
.section-controls select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  color: white;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

.section-controls input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.section-controls input:focus,
.section-controls select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.action-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   Table Styling
   ============================================================================ */

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: rgba(52, 152, 219, 0.2);
  color: white;
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
  padding: 1rem;
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================================================
   Status Badges
   ============================================================================ */

.status-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-created {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.status-shipped {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.status-delivered {
  background: rgba(46, 125, 50, 0.2);
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, 0.3);
}

.status-failed {
  background: rgba(198, 40, 40, 0.2);
  color: #c62828;
  border: 1px solid rgba(198, 40, 40, 0.3);
}

/* ============================================================================
   Loading Spinner
   ============================================================================ */

.loading-container {
  text-align: center;
  padding: 3rem;
}

.spinner {
  color: #3498db;
  font-size: 2rem;
}

/* ============================================================================
   Pagination
   ============================================================================ */

.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  color: rgba(255, 255, 255, 0.7);
}

.pagination-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================================
   Responsive Styles
   ============================================================================ */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
  .dashboard-container {
    padding: 1.5rem;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
  }
  
  .orders-section {
    padding: 1.5rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .table-container {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 0.75rem 0.5rem;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .header-center h2 {
    display: none;
  }
  
  .back-btn,
  .btn-signIn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
  
  header {
    padding: 1rem;
  }

  .dashboard-container {
    padding: 1rem;
    margin-top: 80px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dashboard-card {
    padding: 1.25rem;
  }
  
  .card-value {
    font-size: 1.75rem;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .section-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .section-controls input,
  .section-controls select {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .action-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .pagination-container {
    flex-direction: column;
    gap: 1rem;
  }

  /* Enhanced table responsiveness */
  .table-container {
    font-size: 0.8rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
  }
  
  table {
    min-width: 600px; /* Ensure table doesn't get too compressed */
  }

  th, td {
    padding: 0.6rem 0.4rem;
    white-space: nowrap;
  }
  
  /* Make some columns more compact on mobile */
  th:nth-child(3), td:nth-child(3), /* From column */
  th:nth-child(4), td:nth-child(4), /* Service column */
  th:nth-child(6), td:nth-child(6) { /* Date column */
    min-width: 80px;
  }
  
  /* Tracking number and shipper columns get more space */
  th:nth-child(1), td:nth-child(1), /* Tracking # */
  th:nth-child(2), td:nth-child(2) { /* Shipper */
    min-width: 120px;
  }
}

/* Mobile Phones */
@media (max-width: 480px) {
  header {
    padding: 0.75rem;
  }
  
  .nav-container {
    gap: 0.5rem;
  }
  
  .back-btn,
  .btn-signIn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .orobor-logo-white {
    height: 32px;
  }

  .dashboard-container {
    padding: 0.75rem;
    margin-top: 70px;
  }
  
  .dashboard-card {
    padding: 1rem;
  }
  
  .card-header {
    gap: 0.75rem;
  }
  
  .card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  
  .card-title {
    font-size: 0.9rem;
  }
  
  .card-value {
    font-size: 1.5rem;
  }
  
  .card-label {
    font-size: 0.8rem;
  }

  .orders-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .section-title {
    font-size: 1.4rem;
  }

  .section-controls input,
  .section-controls select {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  .action-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.4rem;
  }

  /* Mobile table optimizations */
  .table-container {
    font-size: 0.75rem;
    margin: 0 -0.75rem; /* Extend to edges on mobile */
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  table {
    min-width: 500px;
  }

  th, td {
    padding: 0.5rem 0.3rem;
  }
  
  /* Further compress certain columns on very small screens */
  th:nth-child(3), td:nth-child(3), /* From column */
  th:nth-child(4), td:nth-child(4), /* Service column */
  th:nth-child(6), td:nth-child(6) { /* Date column */
    min-width: 60px;
    font-size: 0.7rem;
  }
  
  /* Status column gets special treatment */
  th:nth-child(7), td:nth-child(7) {
    min-width: 70px;
  }
  
  .status-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* Very Small Screens */
@media (max-width: 360px) {
  .dashboard-container {
    padding: 0.5rem;
  }
  
  .orders-section {
    padding: 0.75rem;
  }
  
  .dashboard-card {
    padding: 0.75rem;
  }
  
  .card-value {
    font-size: 1.25rem;
  }
  
  .section-title {
    font-size: 1.2rem;
  }
  
  .table-container {
    font-size: 0.7rem;
  }
  
  th, td {
    padding: 0.4rem 0.2rem;
  }
  
  table {
    min-width: 450px;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .dashboard-container {
    margin-top: 60px;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .table-container {
    font-size: 0.75rem;
  }
  
  th, td {
    padding: 0.4rem 0.3rem;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .table-container {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

