/*
 * Bootstrap 5 with custom color scheme for 3D Print Calculator
 * Using Bootstrap's CSS custom properties for theming
 */

/* Import Bootstrap 5 from CDN */
@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css");

/* Import Bootstrap Icons from CDN */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css");


/* Bootstrap 5 Custom Color Variables */
:root {
  /* Moab Desert-inspired color palette */
  --bs-primary: #c8102e; /* Deep red rock */
  --bs-primary-rgb: 200, 16, 46;
  --bs-secondary: #d2691e; /* Sandstone orange */
  --bs-secondary-rgb: 210, 105, 30;
  --bs-success: #9caf88; /* Desert sage */
  --bs-success-rgb: 156, 175, 136;
  --bs-info: #87ceeb; /* Desert sky blue */
  --bs-info-rgb: 135, 206, 235;
  --bs-warning: #f4a460; /* Sandy brown */
  --bs-warning-rgb: 244, 164, 96;
  --bs-danger: #cd853f; /* Terracotta */
  --bs-danger-rgb: 205, 133, 63;
  --bs-light: #fff8dc; /* Desert cream */
  --bs-light-rgb: 255, 248, 220;
  --bs-dark: #2c1810; /* Dark brown text */
  --bs-dark-rgb: 44, 24, 16;

  /* Custom accent colors */
  --moab-stone: #d2b48c; /* Light sandstone */
  --moab-shadow: #8b4513; /* Dark rock shadow */
  --moab-cream: #fff8dc; /* Desert cream */

  /* Bootstrap component customizations */
  --bs-body-bg: #f8f9fa;
  --bs-body-color: var(--bs-dark);
  --bs-link-color: var(--bs-primary);
  --bs-link-hover-color: var(--bs-secondary);

  /* Border and shadow customizations */
  --bs-border-color: var(--moab-stone);
  --bs-box-shadow: 0 0.125rem 0.25rem rgba(139, 69, 19, 0.075);
  --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(139, 69, 19, 0.075);
  --bs-box-shadow-lg: 0 1rem 3rem rgba(139, 69, 19, 0.175);
}

/* Custom body styling with gradient background */
body {
  background: linear-gradient(135deg, var(--bs-light) 0%, #f5f5dc 100%);
  min-height: 100vh;
}

/* Custom navbar styling to match the Moab theme */
.navbar {
  background: linear-gradient(
    135deg,
    var(--bs-primary) 0%,
    var(--bs-secondary) 100%
  ) !important;
  box-shadow: 0 2px 10px rgba(200, 16, 46, 0.2);
}

.navbar-brand,
.navbar-nav .nav-link {
  color: white !important;
  font-weight: 600;
}

.navbar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.375rem;
  color: white !important;
}

/* Custom button styling */
.btn-primary {
  background: linear-gradient(
    135deg,
    var(--bs-primary) 0%,
    var(--bs-secondary) 100%
  );
  border: none;
  box-shadow: 0 0.125rem 0.5rem rgba(200, 16, 46, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #a80e26 0%, #b85a1a 100%);
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 1rem rgba(200, 16, 46, 0.3);
}

/* Custom card styling with Moab theme */
.card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--moab-stone);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(139, 69, 19, 0.1);
  backdrop-filter: blur(10px);
}

.card-header {
  background: linear-gradient(135deg, var(--bs-success) 0%, #a8c596 100%);
  color: white;
  border-bottom: 1px solid var(--moab-stone);
  font-weight: 600;
}

/* Table styling */
.table {
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 0.5rem rgba(139, 69, 19, 0.075);
}

.table thead th {
  background: linear-gradient(135deg, var(--bs-success) 0%, #a8c596 100%);
  color: white;
  border: none;
  font-weight: 600;
}

.table tbody tr:hover {
  background-color: rgba(200, 16, 46, 0.05);
}

/* Form styling */
.form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(200, 16, 46, 0.25);
}

.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(200, 16, 46, 0.25);
}

/* Alert styling with custom colors */
.alert-success {
  background-color: rgba(156, 175, 136, 0.1);
  border-color: var(--bs-success);
  color: #155724;
}

.alert-danger {
  background-color: rgba(205, 133, 63, 0.1);
  border-color: var(--bs-danger);
  color: #721c24;
}

/* Toast/Flash message styling - Bottom positioned ephemeral notifications */
#flash {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  width: auto;
  max-width: 90vw;
}

.toast-message {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 2rem;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  min-width: 300px;
  max-width: 500px;
  animation: toastSlideIn 0.3s ease-out;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast-icon {
  font-size: 1.25rem;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-text {
  flex: 1;
  color: var(--bs-dark);
  font-size: 0.9rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--bs-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

/* Toast type colors */
.toast-notice,
.toast-success {
  border-left: 4px solid var(--bs-success);
}

.toast-notice .toast-icon,
.toast-success .toast-icon {
  color: var(--bs-success);
}

.toast-alert,
.toast-error {
  border-left: 4px solid var(--bs-danger);
}

.toast-alert .toast-icon,
.toast-error .toast-icon {
  color: var(--bs-danger);
}

.toast-info {
  border-left: 4px solid var(--bs-info);
}

.toast-info .toast-icon {
  color: var(--bs-info);
}

/* Toast animations */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(2rem);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  #flash {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: none;
    max-width: none;
  }

  .toast-message {
    min-width: auto;
    width: 100%;
  }
}

/* Badge styling */
.badge {
  font-weight: 600;
}

.badge.bg-primary {
  background: linear-gradient(
    135deg,
    var(--bs-primary) 0%,
    var(--bs-secondary) 100%
  ) !important;
}

/* Container enhancements */
.container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 2rem rgba(139, 69, 19, 0.1);
  backdrop-filter: blur(10px);
  padding: 2rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

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

  .navbar {
    border-radius: 0;
  }
}

/* Custom utilities for the Moab theme */
.bg-moab-cream {
  background-color: var(--moab-cream) !important;
}

.text-moab-shadow {
  color: var(--moab-shadow) !important;
}

.border-moab-stone {
  border-color: var(--moab-stone) !important;
}

/* Dropdown menu fix */

.pricing-card {
  backdrop-filter: none !important;
}

/* Print styles */
@media print {
  body {
    background: white !important;
  }

  .container {
    box-shadow: none !important;
    background: white !important;
  }

  .btn {
    display: none !important;
  }
}

/* ============================================================================
   RAILS ADMIN SPECIFIC STYLES
   ============================================================================
   These styles are specific to the Rails Admin interface (/admin)
   Previously extracted from a large rails_admin.css file that contained
   full Bootstrap CSS. Since we already have Bootstrap in our main app,
   these are only the Rails Admin-specific customizations.
   ========================================================================= */

body.rails_admin {
  /* Top navigation */
  padding-top: 3.275rem;
  /* Sidebar navigation */
  /* Main form */
  /* Action tabs */
  /* Table cells behaviour */
  /* Dashboard */
  /* Index */
}

/* line 9, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .thumbnail {
  display: inline-block;
}

/* line 17, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .navbar .edit_user_root_link {
  position: relative;
}

/* line 20, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .navbar .edit_user_root_link img {
  position: absolute;
  top: calc((40px - $avatar-size) / 2);
}

/* line 24, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .navbar .edit_user_root_link img + span {
  margin-left: 35px;
}

/* line 32, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav {
  padding: 0;
}

/* line 35, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle {
  margin-top: calc(1.5rem / 2);
  padding: 3px calc(1.5rem / 2);
  font-weight: bold;
  color: #6c757d;
}

/* line 42, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle[aria-expanded="true"] {
  color: #495057;
}

/* line 46, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle-nav > li > a {
  padding: 3px calc(1.5rem / 2);
  color: #6c757d;
}

/* line 50, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle-nav > li > a.active {
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 0.375rem;
  color: #495057;
}

/* line 55, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle-nav > li > a:hover {
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 0.375rem;
  color: #495057;
}

/* line 60, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle-nav > li > a.nav-level-1 {
  padding-left: calc(1.5rem / 2 + 1rem);
}

/* line 63, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle-nav > li > a.nav-level-2 {
  padding-left: calc(1.5rem / 2 + 2rem);
}

/* line 66, ../../../.rvm/gems/ruby-3.4.4/gems/rails_admin-3.3.0/src/rails_admin/styles/base/theming.scss */
body.rails_admin .sidebar.btn-toggle-nav .btn-toggle-nav > li > a.nav-level-3 {
  padding-left: calc(1.5rem / 2 + 3rem);
}

/* Additional Rails Admin form, table, and component styles would continue here */
/* Note: This is a condensed version - the full Rails Admin styles are extensive */
/* but these core navigation and sidebar styles are the most critical for functionality */

/* ============================
   PRINTER SHOW PAGE STYLES
   ============================ */

.printer-show-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.printer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3rem;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.printer-title h1 {
  color: #c8102e;
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
}

.manufacturer-badge {
  background: #9caf88;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
}

.printer-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.printer-content {
  display: grid;
  gap: 2rem;
}

/* Specifications Section */
.specs-section h2,
.financial-section h2,
.print-jobs-section h2 {
  color: #c8102e;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

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

.spec-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.spec-icon {
  font-size: 2rem;
  min-width: 3rem;
  text-align: center;
}

.spec-details {
  flex: 1;
}

.spec-details label {
  display: block;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.spec-details span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

/* Financial Status Section */
.status-cards {
  display: grid;
  gap: 1rem;
}

.status-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.status-card.paid-off {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: #b6d7a8;
}

.status-card.in-progress {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-color: #f0d000;
}

.status-icon {
  font-size: 3rem;
}

.status-content h3 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1.3rem;
  font-weight: 700;
}

.status-content p {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

/* Print Jobs Section */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.print-jobs-list {
  display: grid;
  gap: 1rem;
}

.print-job-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.print-job-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.job-info h4 {
  margin: 0 0 0.5rem 0;
  color: #c8102e;
  font-size: 1.1rem;
  font-weight: 600;
}

.job-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.detail-item {
  font-size: 0.9rem;
  color: #666;
}

.job-pricing {
  text-align: right;
  flex-shrink: 0;
}

.total-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #9caf88;
  margin-bottom: 0.5rem;
}

.job-actions .small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.show-more {
  text-align: center;
  padding: 1rem;
}

.empty-jobs {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-jobs h3 {
  color: #666;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.empty-jobs p {
  color: #888;
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Printer Page Button Styles */
.printer-show-container .primary-button {
  background: linear-gradient(135deg, #c8102e 0%, #d2691e 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.printer-show-container .primary-button:hover {
  background: linear-gradient(135deg, #a80e26 0%, #b85a1a 100%);
  text-decoration: none;
  color: white;
  transform: translateY(-1px);
}

.printer-show-container .secondary-button {
  background: transparent;
  color: #666;
  border: 2px solid #ddd;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.printer-show-container .secondary-button:hover {
  background-color: #f8f9fa;
  border-color: #ccc;
  text-decoration: none;
  color: #555;
}

.printer-show-container .secondary-button.small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Responsive Design for Printer Show */
@media (max-width: 768px) {
  .printer-show-container {
    padding: 1rem 0.5rem;
  }

  .printer-header {
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
  }

  .printer-title h1 {
    font-size: 2rem;
  }

  .printer-actions {
    justify-content: center;
  }

  .specs-grid {
    grid-template-columns: 1fr;
  }

  .spec-card {
    padding: 1rem;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .print-job-card {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .job-pricing {
    text-align: center;
  }

  .job-details {
    justify-content: center;
  }

  .status-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .printer-title h1 {
    font-size: 1.5rem;
  }

  .job-details {
    flex-direction: column;
    gap: 0.5rem;
  }

  .detail-item {
    text-align: center;
  }
}

/* ============================
   PRINTER FORM STYLES
   ============================ */

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  color: #c8102e;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.printer-form {
  max-width: 1000px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.form-card h3 {
  margin: 0 0 1.5rem 0;
  color: #c8102e;
  font-size: 1.3rem;
  font-weight: 600;
  border-bottom: 2px solid #9caf88;
  padding-bottom: 0.5rem;
}

.field-group {
  margin-bottom: 1.5rem;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.field-group input,
.field-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.field-group input:focus,
.field-group select:focus {
  border-color: #c8102e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.field-group small {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-style: italic;
}

.currency-input {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  transition: border-color 0.2s ease;
}

.currency-input:focus-within {
  border-color: #c8102e;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.currency-symbol {
  padding: 0.75rem;
  background: #f8f9fa;
  border-right: 1px solid #ddd;
  font-weight: 600;
  color: #666;
  min-width: 60px;
  text-align: center;
}

.currency-input input {
  border: none;
  border-radius: 0 8px 8px 0;
  flex: 1;
}

.currency-input input:focus {
  box-shadow: none;
}

.form-actions {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px dashed #9caf88;
}

.printer-form .primary-button {
  background: linear-gradient(135deg, #c8102e 0%, #d2691e 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  margin-right: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.printer-form .primary-button:hover {
  background: linear-gradient(135deg, #a80e26 0%, #b85a1a 100%);
  text-decoration: none;
  color: white;
}

.printer-form .secondary-button {
  background: transparent;
  color: #666;
  border: 2px solid #ddd;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.printer-form .secondary-button:hover {
  background-color: #f8f9fa;
  border-color: #ccc;
  text-decoration: none;
  color: #555;
}

.error-messages {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  color: #721c24;
}

.error-messages h3 {
  margin-top: 0;
  color: #721c24;
}

.error-messages ul {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    margin: 0;
  }
}

/* ============================
   READONLY/DISABLED INPUT STYLES
   ============================ */

/* Enhanced visual indicators for readonly and disabled inputs */
input[readonly],
textarea[readonly],
select[readonly],
.form-control[readonly],
.form-select[readonly] {
  background-color: #f8f9fa !important;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.02) 2px,
    rgba(0, 0, 0, 0.02) 4px
  );
  border-color: #e0e0e0 !important;
  color: #6c757d !important;
  cursor: not-allowed;
  opacity: 0.8;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

input[readonly]:focus,
textarea[readonly]:focus,
select[readonly]:focus,
.form-control[readonly]:focus,
.form-select[readonly]:focus {
  background-color: #f8f9fa !important;
  border-color: #e0e0e0 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  outline: none;
}

/* Specific styling for invoice number preview fields */
.form-control.text-muted[readonly] {
  background-color: #f1f3f4 !important;
  border: 2px dashed #dee2e6 !important;
  font-style: italic;
  position: relative;
}

.form-control.text-muted[readonly]::before {
  content: "🔒";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
  pointer-events: none;
}

/* Line item total fields specific styling */
.line-item-total[readonly] {
  background-color: #e8f5e8 !important;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 8px,
    rgba(156, 175, 136, 0.1) 8px,
    rgba(156, 175, 136, 0.1) 16px
  );
  border: 2px solid #9caf88 !important;
  font-weight: 600;
  text-align: right;
  color: #2d5016 !important;
}

.line-item-total[readonly]:focus {
  background-color: #e8f5e8 !important;
  border-color: #9caf88 !important;
  box-shadow: 0 0 0 0.2rem rgba(156, 175, 136, 0.25) !important;
}

/* Disabled input styling */
input[disabled],
textarea[disabled],
select[disabled],
.form-control[disabled],
.form-select[disabled] {
  background-color: #e9ecef !important;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  border-color: #ced4da !important;
  color: #6c757d !important;
  cursor: not-allowed;
  opacity: 0.65;
}

/* Lock icon for readonly fields (using CSS pseudo-element) */
.readonly-field-container {
  position: relative;
}

.readonly-field-container::after {
  content: "🔒";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.6;
  pointer-events: none;
  z-index: 10;
}

/* Special icon for computed/calculated fields */
.readonly-field-container:has(.computed-field)::after {
  content: "🧮";
  font-size: 14px;
  opacity: 0.7;
}

/* Special icon for preview fields */
.readonly-field-container:has(.preview-field)::after {
  content: "👁️";
  font-size: 12px;
  opacity: 0.6;
}

/* Alternative styling for calculated/computed fields */
.computed-field[readonly] {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border: 2px solid #4a90e2 !important;
  border-style: dashed;
  font-family: "Courier New", monospace;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Hover effects for readonly fields to reinforce non-interactivity */
input[readonly]:hover,
textarea[readonly]:hover,
select[readonly]:hover,
.form-control[readonly]:hover,
.form-select[readonly]:hover {
  border-color: #e0e0e0 !important;
  cursor: not-allowed;
}

/* Bootstrap override for readonly form controls */
.form-control[readonly]:focus,
.form-select[readonly]:focus {
  border-color: #e0e0e0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Special styling for preview/placeholder readonly fields */
.preview-field[readonly] {
  background: repeating-linear-gradient(
    90deg,
    #f8f9fa,
    #f8f9fa 10px,
    #e9ecef 10px,
    #e9ecef 20px
  ) !important;
  border: 2px dashed #6c757d !important;
  color: #495057 !important;
  font-style: italic;
}

/* Enhanced computed field styling with subtle animation */
.computed-field[readonly] {
  background: linear-gradient(135deg, #e8f5e8 0%, #f1f8f1 100%) !important;
  border: 2px solid #9caf88 !important;
  color: #2d5016 !important;
  font-weight: 600;
  text-align: center;
  font-style: italic;
  position: relative;
  overflow: hidden;
}

.computed-field[readonly]::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(156, 175, 136, 0.3),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Auto-calculated text styling */
input[value*="Auto-calculated"],
input[placeholder*="Auto-calculated"] {
  color: #28a745 !important;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Additional visual cue for calculated fields */
.line-item-total.computed-field[readonly] {
  text-align: right;
  padding-right: 35px; /* Make room for the calculator icon */
}

/* Tooltip-like effect on hover for computed fields */
.computed-field[readonly]:hover {
  border-color: #7ba66a !important;
  transform: scale(1.02);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(156, 175, 136, 0.3) !important;
}

.computed-field[readonly]:hover::after {
  opacity: 1;
}

/* ========================================
   Image Upload Component Styles
   ======================================== */

.image-upload-container .upload-area {
  background-color: #f8f9fa;
  border-color: #dee2e6 !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.image-upload-container .upload-area:hover {
  background-color: #e9ecef;
  border-color: #c8102e !important;
}

.image-upload-container.drag-over .upload-area {
  background-color: rgba(200, 16, 46, 0.05);
  border-color: #c8102e !important;
  transform: scale(1.01);
}

.image-upload-container .upload-area .fas {
  color: #6c757d;
}

.image-upload-container.drag-over .upload-area .fas {
  color: #c8102e;
}

/* Preview image styling */
.image-upload-container img[data-image-upload-target="preview"] {
  border: 2px solid #dee2e6;
  background-color: #fff;
  object-fit: contain;
}

/* File input styling */
.image-upload-container input[type="file"] {
  position: relative;
  z-index: 10;
}

/* Error alert styling */
.image-upload-container .alert-danger {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}

/* Remove button hover effect */
.image-upload-container .btn-outline-danger:hover {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-upload-container .upload-area {
    padding: 1rem !important;
  }

  .image-upload-container img[data-image-upload-target="preview"] {
    max-width: 120px !important;
    max-height: 60px !important;
  }
}
