/*
 * 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.
 */

body { margin: 0; }
header, nav { margin: 0 !important; }

/* Base */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
}

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

/* Page Headers */
h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #212529;
}

/* Links */
a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Secondary Links */
.link-secondary {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 1rem;
  display: inline-block;
}

.link-secondary:hover {
  color: #5a6268;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

img.photo {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

td, th {
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

/* Navigation */
nav {
  background: #333;
  padding: 10px;
  margin-bottom: 20px;
}

nav a {
  color: white;
  margin-right: 20px;
}

nav a:hover {
  opacity: 0.8;
}

/* Empty States */
.empty {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 40px;
}

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

.muted {
  color: #666;
  font-size: 0.9em;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-draft {
  background-color: #6c757d;
  color: white;
}

.badge-pending {
  background-color: #ffc107;
  color: #212529;
}

.badge-active {
  background-color: #28a745;
  color: white;
}

.badge-completed {
  background-color: #17a2b8;
  color: white;
}

.badge-terminated {
  background-color: #dc3545;
  color: white;
}

.badge-expired {
  background-color: #868e96;
  color: white;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  text-decoration: none;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-color: #0066cc;
  color: white;
  border: 1px solid #0066cc;
  transition: all 0.15s ease-in-out;
}

.btn:hover {
  background-color: #0056b3;
  border-color: #0056b3;
  text-decoration: none;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}

.btn-primary:hover {
  background-color: #0069d9;
  border-color: #0062cc;
}

.btn-primary:disabled {
  background-color: #6c757d;
  border-color: #6c757d;
  cursor: not-allowed;
}

/* Forms */
form {
  max-width: 600px;
  margin: 0 auto;
}

.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #495057;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="number"]:focus,
.field input[type="tel"]:focus,
.field input[type="url"]:focus,
.field textarea:focus,
.field select:focus {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

.field input[type="file"]:focus {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff;
  outline: 0;
}

.actions {
  margin-top: 2rem;
  text-align: right;
}

.actions input[type="submit"],
.actions button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: #fff;
  background-color: #007bff;
  border: 1px solid #007bff;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.actions input[type="submit"]:hover,
.actions button:hover {
  background-color: #0069d9;
  border-color: #0062cc;
}

.actions input[type="submit"]:focus,
.actions button:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
  outline: 0;
}

/* Error messages */
#error_explanation {
  background-color: #f8d7da;
  color: #721c24;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid #f5c6cb;
  border-radius: 0.375rem;
}

#error_explanation h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

#error_explanation ul {
  margin-bottom: 0;
  padding-left: 1.5rem;
}

#error_explanation li {
  margin-bottom: 0.25rem;
}

/* Field with errors */
.field_with_errors {
  display: contents;
}

.field_with_errors input,
.field_with_errors textarea,
.field_with_errors select {
  border-color: #dc3545;
}

.field_with_errors label {
  color: #dc3545;
}

/* Model preference badges */
.model-badge .badge {
  font-size: 0.875rem;
  padding: 0.4rem 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.model-badge .badge i {
  font-size: 1rem;
}

.model-badge .badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000;
}

.model-badge .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000;
}

.model-badge .badge.bg-success {
  background-color: #198754 !important;
  color: #fff;
}

/* Agent card enhancements */
.agent-card .model-badge {
  margin-top: 0.5rem;
}
