/* Analytics Application Styles */

/* Layout and Navigation */
.nav-bar {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: bold;
  color: #111827;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  margin-left: 2rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 1rem 0;
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: #111827;
  border-bottom-color: #d1d5db;
}

.nav-link.active {
  color: #111827;
  border-bottom-color: #6366f1;
}

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

.nav-user-email {
  font-size: 0.875rem;
  color: #6b7280;
}

.nav-sign-out {
  font-size: 0.875rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-sign-out:hover {
  color: #111827;
}

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

.container-narrow {
  max-width: 42rem;
}

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

.page-title {
  font-size: 1.875rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  color: white;
  background-color: #6366f1;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background-color: #4f46e5;
}

.btn-secondary {
  color: #374151;
  background-color: white;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background-color: #f9fafb;
}

.btn-light {
  color: #6366f1;
  background-color: #eef2ff;
  border: 1px solid transparent;
}

.btn-light:hover {
  background-color: #e0e7ff;
}

.btn-danger {
  color: #dc2626;
  background: none;
  border: none;
  text-decoration: none;
}

.btn-danger:hover {
  color: #991b1b;
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Tables */
.table-container {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}

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

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
}

.table tr:last-child td {
  border-bottom: none;
}

/* Cards */
.card {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-body {
  padding: 1.25rem 1.5rem;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin: 0;
}

.card-value {
  font-size: 1.875rem;
  font-weight: 600;
  color: #111827;
  margin-top: 0.25rem;
}

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

/* Lists */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item:last-child {
  border-bottom: none;
}

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

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

.alert-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.alert-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

/* Code blocks */
.code {
  font-family: monospace;
  font-size: 0.75rem;
  background-color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.code-block {
  font-family: monospace;
  font-size: 0.75rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.75rem;
  overflow-x: auto;
  white-space: pre;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-state h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

/* Select dropdown */
.select {
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  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.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  appearance: none;
}

/* Details/Summary */
details summary {
  cursor: pointer;
  color: #6366f1;
}

details summary:hover {
  color: #4f46e5;
}

/* Sections */
.section {
  margin-top: 2rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 1rem;
}

/* Filter form */
.filter-form {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.filter-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.filter-form .btn {
  margin-bottom: 0;
}

/* Links */
.btn-link {
  color: #6366f1;
  text-decoration: none;
  font-size: 0.875rem;
}

.btn-link:hover {
  color: #4f46e5;
}