/* static/css/style.css */

/* ===== VARIABLES ===== */
:root {
  --primary-color: #1a4b84;
  --secondary-color: #c49a3a;
  --accent-color: #8e3c36;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --gray-light: #e9ecef;
  --gray: #6c757d;
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: 'Calibri', 'Georgia', 'Times New Roman', serif;
  --transition: all 0.3s ease;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 4px;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #fff;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--secondary-color);
}

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

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  height: calc(100vh - 150px); /* minus header + footer */
  padding: 0 10px;
  overflow-y: auto;
  /* overflow: hidden; */
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin-bottom: 0.7rem;
  color: var(--primary-color);
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  font-weight: 400;
  color: #212529;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.3;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0d3a6b;
  border-color: #0d3a6b;
  color: #fff;
}

.btn-secondary {
  color: #fff;
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #a47c2d;
  border-color: #a47c2d;
  color: #fff;
}

/* mobile menu */
.no-scroll {
    overflow: hidden;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/hero-bg.jpg') no-repeat center center/cover;
  color: #fff;
  padding: 6rem 0;
  text-align: center;
}

.hero h1 {
  color: #fff;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* ===== CONTENT SECTIONS ===== */
.section {
  padding: 2rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--secondary-color);
  margin: 0.5rem auto;
}

.section-light {
  background-color: var(--light-color);
}

/* ===== CARDS ===== */
.card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* ===== FORM STYLES ===== */
.form-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.form-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--gray-light);
}

.form-title {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: var(--gray);
  font-size: 1.1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.form-row {
  margin-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 0.5rem;
}

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

.form-label.required::after {
  content: " *";
  color: var(--danger-color);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--dark-color);
  background-color: #fff;
  border: 2px solid var(--gray-light);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

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

.form-control::placeholder {
  color: var(--gray);
  opacity: 0.7;
}

/* Textarea specific styles */
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Select dropdown styles */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

/* File input styles */
.form-file {
  position: relative;
}

.form-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.form-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 2px dashed var(--gray-light);
  border-radius: var(--border-radius);
  background-color: var(--light-color);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.form-file-label:hover {
  border-color: var(--primary-color);
  background-color: rgba(26, 75, 132, 0.05);
}

.form-file-label i {
  font-size: 2rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.form-file-preview {
  margin-top: 1rem;
  display: none;
}

.form-file-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--border-radius);
}

/* Checkbox and Radio styles */
.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-check-input {
  margin-right: 0.75rem;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid var(--gray-light);
  border-radius: 3px;
  appearance: none;
  background-color: #fff;
  transition: var(--transition);
  position: relative;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-input:checked::before {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 0.8em;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input[type="radio"]:checked::before {
  content: "";
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background-color: white;
}

.form-check-label {
  margin-bottom: 0;
  cursor: pointer;
}

/* Checkbox/Radio groups */
.checkbox-group,
.radio-group {
  background: var(--light-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.checkbox-group .form-check,
.radio-group .form-check {
  margin-bottom: 0.75rem;
}

/* Date input styles */
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
  appearance: none;
}

/* Validation styles */
.form-control.is-invalid {
  border-color: var(--danger-color);
}

.form-control.is-valid {
  border-color: var(--success-color);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--danger-color);
}

.valid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--success-color);
}

.form-control.is-invalid ~ .invalid-feedback,
.form-control.is-valid ~ .valid-feedback {
  display: block;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gray-light);
}

.address-section {
  background: var(--light-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-color);
}

#mailing_address_display {
    background-color: rgba(26, 75, 132, 0.05);
    border-color: var(--primary-color);
}

#address_preview {
    font-family: monospace;
    background: white;
    padding: 0.5rem;
    border-radius: 3px;
    border: 1px solid var(--gray-light);
}

/* Smooth transitions */
.address-section,
#mailing_address_fields,
#mailing_address_display {
    transition: all 0.3s ease;
}

/* Responsive form styles */
@media (max-width: 768px) {
  .form-section {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
    
  .form-actions {
    flex-direction: column;
  }
    
  .form-actions .btn {
    width: 100%;
  }
  .address-section {
    padding: 1rem;
  }  
}

/* Loading state */
.form-loading {
  opacity: 0.7;
  pointer-events: none;
}

.form-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Success message */
.form-success {
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.2);
  color: var(--success-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  display: none;
}

/* ===== ALERTS ===== */
.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
}

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

.alert-error {
  background-color: #f2dede;
  border-color: #ebccd1;
  color: #a94442;
}

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

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

/* ===== MESSAGES ===== */
/* .messages {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
}

.message {
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  transition: opacity 0.5s ease;
}

.message.info {
  background-color: #d9edf7;
  border-color: #bce8f1;
  color: #31708f;
}

.message.success {
  background-color: #dff0d8;
  border-color: #d6e9c6;
  color: #3c763d;
}

.message.warning {
  background-color: #fcf8e3;
  border-color: #faebcc;
  color: #8a6d3b;
}

.message.error {
  background-color: #f2dede;
  border-color: #ebccd1;
  color: #a94442;
} */

/* ===== FOOTER ===== */
.footer {
  /* background-color: var(--dark-color); */
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.5rem 0 0.5rem;
}

.footer a {
  color: #fff;
}

.footer a:hover {
  color: var(--secondary-color);
}

.footer-title {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  /* border-top: 1px solid rgba(255, 255, 255, 0.1); */
  padding-top: 0.2rem;
  margin-top: 0.5rem;
  text-align: center;
}

@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .hero {
    padding: 3rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .navbar-container {
    padding: 0 10px;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* Add to your main style.css */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

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

.mt-4 {
    margin-top: 1.5rem;
}

.text-danger {
    color: var(--danger-color);
}
