/**
 * Dashboard CSS - Mobile First, Modern Design
 * 
 * Color Scheme:
 * Primary: #001F3F (Very Dark Blue)
 * Secondary: #F5F5F5 (Soft White)
 * Accent 1: #FF8C00 (Clear Orange)
 * Accent 2: #FFC72C (Warm Gold Yellow)
 */

:root {
  --primary: #001F3F;
  --primary-soft: #1A537A;
  --secondary: #F5F5F5;
  --secondary-light: #CCCCCC;
  --accent-1: #FF8C00;
  --accent-1-alt: #FF6B35;
  --accent-2: #FFC72C;
  --accent-2-alt: #FFE700;
  --text: #1A202C;
  --text-muted: #718096;
  --border: #E2E8F0;
  --error: #E53E3E;
  --success: #38A169;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--secondary);
}

/* Dashboard Container */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 1.5rem;
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--secondary);
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-icon {
  font-size: 1.25rem;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.logout-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--error);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.logout-btn:hover {
  opacity: 0.9;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  max-width: 1400px;
}

.page-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

.stat-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.stat-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-item.highlight {
  background: var(--accent-2);
  padding: 0.75rem;
  border-radius: 8px;
}

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

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

.stat-item.highlight .stat-value {
  color: var(--primary);
}

.location-list {
  list-style: none;
}

.location-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.location-name {
  font-weight: 500;
}

.location-count {
  color: var(--text-muted);
}

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

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.1);
}

.form-textarea {
  resize: vertical;
}

.color-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-input {
  width: 50px;
  height: 35px;
  border-radius: 6px;
  border: 1px solid #ddd;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.color-hex-input {
  width: 100px;
  font-family: monospace;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.transparent-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
                    linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  cursor: pointer;
  color: #555;
}

.transparent-btn.active {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-soft);
}

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

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* Request Cards */
.requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.request-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

.request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.request-header h3 {
  font-size: 1.25rem;
  color: var(--primary);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-created { background: #E2E8F0; color: #4A5568; }
.status-questions_sent { background: #BEE3F8; color: #2C5282; }
.status-answers_received { background: #C6F6D5; color: #22543D; }
.status-offer_generated { background: #FED7D7; color: #742A2A; }
.status-offer_sent { background: #D6F5D6; color: #22543D; }
.status-completed { background: #C6F6D5; color: #22543D; }
.status-cancelled { background: #FED7D7; color: #742A2A; }

.request-preview {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.request-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.request-actions {
  display: flex;
  gap: 0.5rem;
}

/* Request Details */
.request-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detail-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

.detail-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.request-text {
  white-space: pre-wrap;
  line-height: 1.8;
}

.questions-list {
  list-style: none;
}

.questions-list li {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--secondary);
  border-radius: 8px;
}

.questions-list .answer {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.danger-zone {
  border: 2px solid var(--error);
}

/* Auth Pages */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--secondary);
}

.auth-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.auth-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow-lg);
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.auth-form {
  margin-bottom: 1rem;
}

.auth-footer {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* Code Input */
.code-input-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.code-input {
  width: 50px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: 8px;
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #FED7D7;
  color: #742A2A;
}

.alert-success {
  background: #C6F6D5;
  color: #22543D;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

