/*
 * This is a manifest file that'll be compiled into application.css.
 */

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --error-color: #dc2626;
  --success-color: #16a34a;
}

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

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

/* Navigation */
.navbar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.navbar-nav a {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.navbar-nav a:hover {
  background-color: var(--bg-color);
}

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

/* Flash Messages */
.flash-messages {
  max-width: 600px;
  margin: 1rem auto;
  padding: 0 1rem;
}

.flash {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.flash-notice {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.flash-alert {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Auth Container */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-color);
}

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

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

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-color);
}

.form-checkbox label {
  margin-bottom: 0;
  font-weight: 400;
}

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

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

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

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

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

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

.btn-danger:hover {
  background-color: #b91c1c;
}

/* Auth Links */
.auth-links {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.auth-links a {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  margin: 0.25rem 0;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Error Messages */
.error-messages {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.error-messages h3 {
  color: var(--error-color);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.error-messages ul {
  list-style: none;
  color: var(--error-color);
  font-size: 0.875rem;
}

.error-messages li {
  margin-bottom: 0.25rem;
}

/* Dashboard */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
}

.dashboard-welcome {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.dashboard-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Required Mark */
.required {
  color: var(--error-color);
  margin-left: 0.25rem;
}

/* Readonly Field */
.form-readonly {
  padding: 0.75rem 1rem;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-muted);
}

/* Tooltip */
.tooltip-container {
  position: relative;
  cursor: help;
}

.tooltip-container .tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-color);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-bottom: 0.5rem;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 10;
}

.tooltip-container .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--text-color) transparent transparent transparent;
}

.tooltip-container:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
}

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

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.table th {
  background-color: var(--bg-color);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.table td {
  font-size: 0.9375rem;
}

.table tbody tr:hover {
  background-color: var(--bg-color);
}

.table a {
  color: var(--primary-color);
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.badge-secondary {
  background-color: #f3f4f6;
  color: #6b7280;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* Alert */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.alert h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.alert ul {
  list-style: none;
  margin-top: 0.5rem;
}

.alert li {
  margin-bottom: 0.25rem;
}

.alert-warning {
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.alert-danger {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Button Variants */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

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

.btn-outline:hover {
  background-color: var(--bg-color);
  border-color: var(--text-muted);
}

/* Empty Message */
.empty-message {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  background: var(--card-bg);
  border-radius: 0.5rem;
}

/* Form Section */
.form-section {
  background: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Form Row */
.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.form-row .form-group.half {
  flex: 0 0 calc(50% - 0.5rem);
}

.form-row .form-group.third {
  flex: 0 0 calc(33.333% - 0.667rem);
}

.form-row .form-group.two-thirds {
  flex: 0 0 calc(66.667% - 0.333rem);
}

/* Form Control */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

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

/* Use Location Fields */
.use-location-fields {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

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

.location-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.add-location-wrapper {
  margin-top: 1rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
}

.form-actions .btn {
  width: auto;
}

/* Detail Card */
.detail-card {
  background: var(--card-bg);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.detail-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-color);
}

/* Detail List */
.detail-list {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.75rem 1rem;
}

.detail-list dt {
  font-weight: 500;
  color: var(--text-muted);
}

.detail-list dd {
  color: var(--text-color);
}

.detail-list.horizontal {
  grid-template-columns: repeat(3, 120px 1fr);
}

/* Location Card */
.location-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

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

.location-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.location-card .detail-list {
  grid-template-columns: 140px 1fr;
  font-size: 0.9375rem;
}

/* Detail Footer */
.detail-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .form-row .form-group.half,
  .form-row .form-group.third,
  .form-row .form-group.two-thirds {
    flex: 0 0 100%;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list dt {
    margin-bottom: 0.25rem;
  }

  .detail-list.horizontal {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th,
  .table td {
    padding: 0.75rem;
  }
}

/* Dashboard Stats */
.dashboard-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

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

.dashboard-actions {
  display: flex;
  gap: 1rem;
}

.dashboard-actions .btn {
  width: auto;
}

/* Admin Navigation */
.admin-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.admin-nav-link {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s;
}

.admin-nav-link:hover {
  background-color: var(--bg-color);
  color: var(--text-color);
}

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

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

.checkbox-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
}

/* Copy Section */
.copy-section {
  background: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

/* Stats Row */
.stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 150px;
}

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

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