/* Modern stylesheet for WooCommerce Web App */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-color: #013c76;
  --primary-hover: #002850;
  --accent-color: #fc7905;
  --accent-hover: #e06600;
  --bg-color: #f0f2f5;
  --card-bg: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #666666;
  --border-color: #e9ecef;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(1, 60, 118, 0.15);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Header & Navigation */
header {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background-color: var(--accent-color);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 8px rgba(252, 121, 5, 0.3);
  object-fit: cover;
}

.brand-section h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-section p {
  font-size: 0.75rem;
  opacity: 0.8;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Top Dashboard Statistics */
.stats-banner {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0257a8 100%);
  color: #ffffff;
  padding: 2rem;
  border-radius: 0 0 20px 20px;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

/* Controls Bar (Search and Actions) */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 500px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.95rem;
  background-color: var(--card-bg);
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(1, 60, 118, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
  box-shadow: 0 4px 6px rgba(252, 121, 5, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(252, 121, 5, 0.3);
}

.btn-secondary {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: #f8f9fa;
  border-color: #ced4da;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 8px;
}

.btn-danger-outline {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc3545;
}

.btn-danger-outline:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
}

.btn-edit-outline {
  background-color: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4f46e5;
}

.btn-edit-outline:hover {
  background-color: #e0e7ff;
  border-color: #a5b4fc;
}

/* Section Header for Grouped Orders */
.section-header {
  background-color: #e8eff6;
  color: var(--primary-color);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* Orders Cards Grid */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 480px) {
  .orders-grid {
    grid-template-columns: 1fr;
  }
}

.order-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.order-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #ced4db;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f1f3f5;
  padding-bottom: 0.75rem;
}

.order-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-completed {
  background-color: #d4edda;
  color: #155724;
}

.status-processing {
  background-color: #d1ecf1;
  color: #0c5460;
}

.status-pending {
  background-color: #fff3cd;
  color: #856404;
}

.status-cancelled {
  background-color: #f8d7da;
  color: #721c24;
}

.status-default {
  background-color: #e2e3e5;
  color: #383d41;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-grow: 1;
}

.detail-row {
  display: flex;
  font-size: 0.9rem;
}

.detail-label {
  width: 95px;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-value {
  flex: 1;
  color: var(--text-dark);
}

.detail-total {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.05rem;
}

.card-footer {
  margin-top: 1.25rem;
  border-top: 1px solid #f1f3f5;
  padding-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Modals / Side Panels */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(1, 60, 118, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.modal-panel {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 500px;
  height: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.modal-overlay.active .modal-panel {
  transform: translateX(0);
}

.modal-header {
  padding: 1.5rem;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.modal-close:hover {
  opacity: 1;
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: #f8f9fa;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Forms styling */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}


.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 0.95rem;
  background-color: #ffffff;
  color: var(--text-dark);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(1, 60, 118, 0.1);
}

.form-control::placeholder {
  color: #bbb;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Smart Auto-fill Highlight Section */
.smart-paste-area {
  background-color: #f7fafc;
  border: 2px dashed #cbd5e0;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  transition: all var(--transition-fast);
}

.smart-paste-area:focus-within {
  border-color: var(--accent-color);
  background-color: #fffaf0;
}

.smart-paste-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.smart-paste-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--text-dark);
  resize: none;
  height: 50px;
}

.smart-paste-input:focus {
  outline: none;
}

.smart-paste-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Loading & Toast Screen states */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(1, 60, 118, 0.1);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

/* Floating Action Button for smaller screens */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(252, 121, 5, 0.4);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  transition: all var(--transition-fast);
}

.fab:hover {
  background-color: var(--accent-hover);
  transform: scale(1.05) rotate(90deg);
  box-shadow: 0 6px 20px rgba(252, 121, 5, 0.5);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 350px;
}

.toast {
  background-color: #333333;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--accent-color);
}

.toast-success {
  border-left-color: #28a745;
}

.toast-error {
  border-left-color: #dc3545;
}

.toast-close {
  background: transparent;
  border: none;
  color: #ffffff;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1rem;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Skeleton Loading Cards */
.skeleton-card {
  height: 220px;
  background: linear-gradient(90deg, #f0f2f5 25%, #e9ecef 37%, #f0f2f5 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Highly Optimized Mobile Native-App Aesthetics Overrides */
@media (max-width: 768px) {
  header {
    padding: 0.6rem 1rem;
  }
  
  .brand-section h1 {
    font-size: 0.95rem;
  }
  
  .brand-section p {
    font-size: 0.65rem;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.95rem;
  }
  
  .header-actions .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  
  .header-actions .btn svg {
    width: 12px;
    height: 12px;
  }
  
  .stats-banner {
    padding: 0.8rem;
    gap: 0.5rem;
    grid-template-columns: repeat(4, 1fr);
    border-radius: 0 0 12px 12px;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .stat-card {
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    min-width: 90px;
    text-align: center;
  }
  
  .stat-label {
    font-size: 0.6rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  main {
    padding: 0 0.75rem 5rem 0.75rem;
  }
  
  .controls-bar {
    margin-bottom: 0.75rem;
    gap: 0.5rem;
  }
  
  .search-wrapper {
    min-width: 100%;
  }
  
  .search-input {
    padding: 0.55rem 1rem 0.55rem 2.2rem;
    font-size: 0.85rem;
    border-radius: 8px;
  }
  
  .search-icon {
    left: 0.75rem;
  }
  
  #order-count-badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
  }
  
  .section-header {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    border-left-width: 3px;
  }
  
  .orders-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .order-card {
    padding: 0.85rem;
    border-radius: 10px;
    margin-bottom: 0;
  }
  
  .card-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
  }
  
  .order-number {
    font-size: 0.9rem;
  }
  
  .status-badge {
    padding: 0.15rem 0.45rem;
    font-size: 0.6rem;
    border-radius: 10px;
  }
  
  .card-body {
    gap: 0.3rem;
  }
  
  .detail-row {
    font-size: 0.75rem;
  }
  
  .detail-label {
    width: 70px;
    font-weight: 500;
  }
  
  .detail-value {
    font-weight: 600;
  }
  
  .detail-total {
    font-size: 0.85rem;
  }
  
  .card-footer {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    gap: 0.4rem;
  }
  
  .card-footer .btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  
  .card-footer .btn svg {
    width: 11px;
    height: 11px;
  }
  
  /* Full screen sliding modals on mobile */
  .modal-panel {
    max-width: 100%;
    height: 100%;
  }
  
  .modal-header {
    padding: 0.85rem 1rem;
  }
  
  .modal-title {
    font-size: 0.95rem;
  }
  
  .modal-content {
    padding: 1rem;
  }
  
  .modal-footer {
    padding: 0.85rem 1rem;
  }
  
  .modal-footer .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  .form-group {
    margin-bottom: 0.85rem;
  }
  
  .form-control {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
  }
  
  .form-label {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
  }
  
  .form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    width: 100%;
  }

  textarea.form-control {
    min-height: 85px !important;
  }
  
  .smart-paste-area {
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
  }
  
  .smart-paste-title {
    font-size: 0.7rem;
    margin-bottom: 0.35rem;
  }
  
  .smart-paste-input {
    height: 70px !important;
    font-size: 0.8rem;
  }
  
  .smart-paste-hint {
    font-size: 0.6rem;
  }
  
  .fab {
    width: 46px;
    height: 46px;
    bottom: 1.25rem;
    right: 1.25rem;
    font-size: 1.5rem;
    box-shadow: 0 3px 10px rgba(252, 121, 5, 0.3);
  }
  
  .toast-container {
    bottom: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    max-width: none;
  }
  
  .toast {
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }
}

