/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Navigation */
.nav-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: #86868b;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #1d1d1f;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #1d1d1f;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: #1d1d1f;
}

.header p {
  font-size: 0.9rem;
  text-align: center;
  color: #86868b;
  margin-top: 0.25rem;
}

/* Stats bar */
.stats-bar {
  background: white;
  margin: 1rem;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1d1d1f;
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: #86868b;
  margin-top: 0.25rem;
}

/* Main content */
.main-content {
  background: white;
  margin: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

/* Controls */
.controls {
  padding: 1rem;
  border-bottom: 1px solid #f2f2f2;
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
}

.btn-primary {
  background: #007aff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #0056cc;
}

.btn-secondary {
  background: #f2f2f2;
  color: #1d1d1f;
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e5e7;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Orders container */
.orders-container {
  padding: 1rem;
}

.order-card {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid #f2f2f2;
  transition: all 0.2s ease;
}

.order-card:last-child {
  margin-bottom: 0;
}

.order-card:hover {
  background: #f5f5f7;
  transform: translateY(-1px);
}

.order-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.order-id {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d1d1f;
  text-align: center;
}

.order-status-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.order-id {
  font-size: 1rem;
  font-weight: 600;
  color: #1d1d1f;
}

.order-status {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  min-width: 140px;
  display: inline-block;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.order-status::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.order-status:hover::before {
  left: 100%;
}

.status-ready {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.status-processing {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.status-received {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.status-not-found,
.status-error {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.order-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-weight: 500;
  color: #86868b;
  margin-bottom: 0.25rem;
}

.detail-value {
  color: #1d1d1f;
}

/* Loading and empty states */
.loading,
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #86868b;
}

.loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: #1d1d1f;
  font-weight: 600;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.refresh-indicator {
  display: inline-block;
  margin-left: 0.5rem;
}

.refresh-indicator.loading {
  animation: spin 1s linear infinite;
}

/* Responsive design */
@media (max-width: 767px) {
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-link {
    justify-content: center;
  }

  .controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-bar {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .order-details {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
    padding: 0 1rem;
  }
  
  .stats-bar {
    margin: 1.5rem 0;
  }
  
  .main-content {
    margin: 1.5rem 0;
  }
  
  .controls {
    padding: 1.5rem;
  }
  
  .orders-container {
    padding: 1.5rem;
  }
  
  .order-details {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}
