/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8f9fa;
  line-height: 1.6;
}

/* Navbar Styles */
.navbar {
  background-color: #841617;
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand .brand-link {
  text-decoration: none;
  color: white;
}

.navbar-brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.navbar-brand p {
  margin: 0;
  font-size: 11px;
  opacity: 0.9;
  font-weight: 500;
}

.navbar-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

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

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.nav-divider {
  width: 1px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.3);
  margin: 0 4px;
}

.nav-link.admin-link {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-link.admin-link:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.nav-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-user-name {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
}

.nav-signout {
  font-size: 13px;
  padding: 6px 10px;
}

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

/* Flash Messages */
.flash-messages {
  position: relative;
  z-index: 999;
}

.alert {
  padding: 15px;
  margin: 0 auto 20px;
  max-width: 1200px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
  font-weight: 500;
}

/* Authentication Pages */
.auth-container {
  max-width: 450px;
  margin: 60px auto;
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
  color: #841617;
  font-size: 24px;
  margin: 0 0 24px 0;
  text-align: center;
  font-weight: 700;
}

.auth-container .field {
  margin-bottom: 20px;
}

.auth-container label {
  display: block;
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
  font-size: 14px;
}

.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e9ecef;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.15s ease-in-out;
}

.auth-container input[type="text"]:focus,
.auth-container input[type="email"]:focus,
.auth-container input[type="password"]:focus {
  outline: none;
  border-color: #841617;
  box-shadow: 0 0 0 3px rgba(132, 22, 23, 0.1);
}

.auth-container .field em {
  font-size: 12px;
  color: #6c757d;
  font-style: normal;
}

.auth-container .actions {
  margin-top: 28px;
}

.auth-container input[type="submit"] {
  width: 100%;
  background-color: #841617;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.auth-container input[type="submit"]:hover {
  background-color: #6b1213;
}

.auth-container input[type="checkbox"] {
  margin-right: 8px;
}

.auth-links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  text-align: center;
}

.auth-links a {
  color: #841617;
  text-decoration: none;
  font-size: 14px;
  display: block;
  margin: 8px 0;
}

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

#error_explanation {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 4px;
}

#error_explanation h2 {
  font-size: 16px;
  margin: 0 0 12px 0;
  color: #721c24;
  text-align: left;
}

#error_explanation ul {
  margin: 0;
  padding-left: 20px;
}

#error_explanation li {
  font-size: 14px;
  margin: 4px 0;
}

/* Admin Layout */
.admin-body {
  background-color: #f4f4f5;
}

.admin-navbar {
  background-color: #5a1011;
}

.admin-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.nav-back-to-site {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-back-to-site:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Admin Dashboard */
.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 28px;
  color: #1f2937;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.admin-header p {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.stat-card h3 {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 8px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 32px;
  color: #841617;
  font-weight: 700;
  margin: 0;
}

.stat-card .stat-label {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

/* Admin Tables */
.admin-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-table-header {
  padding: 20px 24px;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-table-header h2 {
  font-size: 18px;
  color: #1f2937;
  margin: 0;
  font-weight: 700;
}

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

.admin-table thead {
  background-color: #f9fafb;
}

.admin-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  color: #374151;
}

.admin-table tbody tr:hover {
  background-color: #f9fafb;
}

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

/* Admin Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

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

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

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-secondary {
  background-color: #e5e7eb;
  color: #374151;
}

/* Admin Buttons */
.btn-admin {
  display: inline-block;
  padding: 8px 16px;
  background-color: #841617;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-admin:hover {
  background-color: #6b1213;
  color: white;
}

.btn-admin-secondary {
  background-color: #6b7280;
}

.btn-admin-secondary:hover {
  background-color: #4b5563;
}

.btn-admin-danger {
  background-color: #dc2626;
}

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

.btn-admin-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
  }

  .navbar-nav {
    gap: 16px;
  }

  .navbar-brand h1 {
    font-size: 16px;
    text-align: center;
  }

  .navbar-brand p {
    font-size: 10px;
    text-align: center;
  }

  .auth-container {
    margin: 30px 20px;
    padding: 30px 24px;
  }

  .nav-user-menu {
    flex-direction: column;
    gap: 8px;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
    width: 100%;
  }
}
