/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f9f9f9;
  color: #333;
  line-height: 1.4;
  padding: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.toast {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  border-radius: 4px;
  color: #fff;
  animation: slideIn 0.3s ease-out, fadeOut 0.5s 2.5s forwards;
}

.toast.success { background: #28a745; }
.toast.error   { background: #dc3545; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* Container & Logo */
.container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: fadeUp 0.5s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo-container {
  text-align: center;
  margin-bottom: 1rem;
}

.logo {
  max-width: 150px;
}

/* Headings */
h1, h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: #333;
}

/* Floating Label Forms */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.form-row label {
  flex: 1;
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0,120,212,0.2);
}

.form-row label span {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  background: #fff;
  padding: 0 0.25rem;
  color: #888;
  pointer-events: none;
  transition: all 0.2s ease;
}

.form-row input:not(:placeholder-shown) + span,
.form-row input:focus + span,
.form-row textarea:not(:placeholder-shown) + span,
.form-row textarea:focus + span {
  top: -0.7rem;
  left: 0.5rem;
  font-size: 0.75rem;
  color: #0078d4;
}

.required {
  color: #d00;
}

/* PDF-only Elements */
.for-pdf {
  display: none !important;
}
.pdf-mode .for-pdf {
  display: block !important;
}
/* hide only the first <h2> (Labor Worksheet) inside .for-pdf in PDF mode */
.pdf-mode .for-pdf h2:first-of-type {
  display: none !important;
}

/* Table Styling */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.estimate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.estimate-table th,
.estimate-table td {
  border: 1px solid #333;
  padding: 6px;
  text-align: center;
  transition: background 0.2s;
}

.estimate-table thead th {
  background: #fff;
  color: #000;
}

.estimate-table tbody tr:hover {
  background: rgba(0,0,0,0.03);
}

.estimate-table input[type="text"] {
  width: 100%;
  padding: 4px;
  border: none;
}

.estimate-table input[type="checkbox"] {
  transform: scale(1.2);
}

.table-actions {
  text-align: right;
  margin-bottom: 1rem;
}

/* Notes Section */
.notes-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.notes-section label {
  flex: 1 1 30%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

/* Buttons & Spinner */
.buttons,
.button-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

button, .btn {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  gap: 0.5rem;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
}

button:disabled, .btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.btn-primary {
  background: #5A9BD4;
  color: #fff;
}

.btn-primary:hover {
  background: #4E89B5;
}

.btn-secondary {
  background: #ECECEC;
  color: #333;
}

.btn-secondary:hover {
  background: #E0E0E0;
}

.btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.6);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal Preview */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  height: 90%;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 2rem;
  color: #333;
  cursor: pointer;
  z-index: 10;
}

#pdfPreviewFrame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Back Button Inside Container */
.back-button-inside {
  text-align: left;
  margin-bottom: 1rem;
}

.btn-back-inside {
  display: inline-block;
  background: #e5e7eb;
  color: #111827;
  font-size: 0.95rem;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-back-inside:hover {
  background: #d1d5db;
  transform: translateX(-2px);
}

/* Landing Page Buttons */
.button-group .btn {
  min-width: 120px;
  height: 45px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
}

#btnEAE {
  background-color: #28a745;
  color: #fff;
}

#btnEAE:hover {
  background-color: #218838;
}

#btn-hail-eae {
  background-color: #fffc3d;
  color: #000000;
}

#btn-hail-eae:hover {
  background-color: #fdf9b8;
}

#btnPDR {
  background-color: #f7b6b6;
  color: #000000;
}

#btnPDR:hover {
  background-color: #f19494;
}

.subtitle {
  font-size: 1rem;
  color: #555;
  margin-bottom: 2rem;
  text-align: center;
}
