/* One Tap Rescue - Modern Orange/Black Theme */

:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fb923c;
  --accent: #1e293b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #fafaf9;
  --card: #ffffff;
  --text: #1c1917;
  --text-muted: #57534e;
  --border: #e7e5e4;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Container */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.header .logo {
  width: 32px;
  height: 32px;
}

/* Main Content */
.main {
  padding: 24px 0;
  min-height: calc(100vh - 68px);
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-large {
  padding: 24px 32px;
  font-size: 1.5rem;
  border-radius: 16px;
}

.btn-small {
  padding: 10px 16px;
  font-size: 0.875rem;
}

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

/* Hero Section */
.hero {
  text-align: center;
  padding: 48px 0;
}

.hero-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.hero h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Service Grid */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.service-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 100px;
}

.service-btn:hover, .service-btn.selected {
  border-color: var(--primary);
  background: rgba(249, 115, 22, 0.08);
}

.service-btn.selected {
  border-width: 3px;
}

.service-btn .icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.service-btn .label {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Location Box */
.location-box {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.location-box .icon {
  font-size: 2rem;
  color: var(--primary);
  margin-top: 2px;
}

.location-box .text {
  flex: 1;
  min-width: 0; /* Allow text to wrap */
}

.location-box .address {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-wrap: break-word;
}

.location-box .coords {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  background: rgba(0,0,0,0.05);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.location-box .btn-small {
  flex-shrink: 0;
  align-self: center;
}

/* Status Tracker */
.status-tracker {
  padding: 24px 0;
}

.status-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.status-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.status-step:not(:last-child) {
  padding-bottom: 24px;
}

.status-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.status-step.completed::before {
  background: var(--success);
}

.status-step.active::before {
  background: linear-gradient(to bottom, var(--success) 50%, var(--border) 50%);
}

.status-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  z-index: 1;
}

.status-step.completed .status-dot {
  background: var(--success);
  color: white;
}

.status-step.active .status-dot {
  background: var(--primary);
  color: white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(249, 115, 22, 0); }
}

.status-content h4 {
  font-weight: 600;
  margin-bottom: 4px;
}

.status-content p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.status-content .time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ETA Box */
.eta-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.eta-box .label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.eta-box .time {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.eta-box .unit {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 4px;
}

/* Provider Info */
.provider-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  margin-top: 16px;
}

.provider-avatar {
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.provider-info h4 {
  font-weight: 600;
}

.provider-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Chat */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9375rem;
}

.chat-message.customer {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message.agent {
  background: var(--bg);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message .time {
  font-size: 0.625rem;
  opacity: 0.7;
  margin-top: 4px;
}

.chat-input-area {
  padding: 16px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  font-size: 1rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Floating Chat Button */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}

.chat-fab:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}

/* Pricing Section */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.pricing-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.pricing-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.pricing-card.popular {
  border-color: var(--primary);
  position: relative;
}

.pricing-card.popular::before {
  content: 'BEST VALUE';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.625rem;
  font-weight: 700;
}

.pricing-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.pricing-period {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pricing-name {
  font-weight: 600;
  margin: 12px 0 8px;
}

.pricing-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Section Navigation */
.section-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.section-nav .btn {
  flex: 1;
  padding: 12px;
  font-size: 0.875rem;
}

/* Screen Visibility */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Admin Styles */
.admin-header {
  background: #1e293b;
}

.admin-nav {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.admin-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: 8px;
}

.admin-nav a:hover, .admin-nav a.active {
  color: white;
  background: rgba(255,255,255,0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.request-table {
  width: 100%;
  border-collapse: collapse;
}

.request-table th, .request-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.request-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.requested { background: #ffedd5; color: #9a3412; }
.status-badge.dispatched { background: #fed7aa; color: #c2410c; }
.status-badge.assigned { background: #fef3c7; color: #92400e; }
.status-badge.en_route { background: #d1fae5; color: #065f46; }
.status-badge.arrived { background: #cffafe; color: #0e7490; }
.status-badge.completed { background: #d1fae5; color: #065f46; }
.status-badge.cancelled { background: #fee2e2; color: #991b1b; }

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Legal Pages */
.legal-content {
  padding: 24px 0;
}

.legal-content h1 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.legal-content h2 {
  font-size: 1.125rem;
  margin: 24px 0 12px;
  color: var(--text);
}

.legal-content p {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal-content ul {
  margin-left: 24px;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 24px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
  .hero h2 {
    font-size: 1.5rem;
  }

  .btn-large {
    padding: 20px 24px;
    font-size: 1.25rem;
  }

  .eta-box .time {
    font-size: 2.5rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid .stat-card:last-child {
    grid-column: 1 / -1;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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