/* style.css - Optional custom styles */

body {
  font-family: 'Inter', sans-serif;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2563eb; /* Tailwind blue-600 */
  box-shadow: 0 0 0 1px #2563eb;
}

output {
  min-width: 60px;
  display: inline-block;
  text-align: right;
}

/* Utility class to right-align column output */
.text-right {
  text-align: right;
}

.section-disabled {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}
.section-disabled::after {
  content: "Not required for this project type";
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  background-color: #fef2f2;
  color: #991b1b;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
}

button[disabled] {
  pointer-events: none;
}

/* Make buttons transition smoothly */
button {
  transition: all 0.2s ease-in-out;
}

/* Center modal properly */
#confirmModal {
  z-index: 1000;
}

/* Responsive adjustments for grid headers */
@media (max-width: 640px) {
  .grid-cols-6 > div {
    font-size: 0.8rem;
  }

  .add-row-btn {
    font-size: 1.5rem;
  }

  .section-wrapper > div.grid {
    grid-template-columns: 1fr !important;
  }

  .section-wrapper input,
  .section-wrapper output,
  .section-wrapper button {
    width: 100% !important;
    margin-top: 4px;
  }

  .section-wrapper .grid {
    gap: 0.5rem;
  }

  .grid-cols-6 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-cols-7 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #labourContent > .grid,
  #materialContent > .grid,
  #fittingsContent > .grid,
  #electricalContent > .grid,
  #plumbingContent > .grid,
  #steelContent > .grid,
  #joineryContent > .grid,
  #windowsContent > .grid,
  #externalMaterialsContent > .grid,
  #consumablesContent > .grid {
    display: none; /* Hide headers on mobile */
  }
}

/* Fix output total alignment */
output {
  display: block;
  min-width: 4rem;
  text-align: right;
}

/* Custom gray delete circle icon styling */
.gray-delete-btn {
  background-color: #e5e7eb;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.gray-delete-btn:hover {
  background-color: #d1d5db;
}

/* Footer logo spacing */
footer img {
  max-height: 24px;
}

.flash-transition {
  transition: background-color 0.4s ease, color 0.4s ease;
}

.flash-red {
  background-color: #fee2e2; /* Light red background */
  color: #dc2626;            /* Red text */
  border-color: #dc2626;     /* Optional: Red border */
}

@media print {
  .no-print {
    display: none !important;
  }
}

@media print {
  #printArea {
    font-size: 12pt;
    line-height: 1.6;
    padding: 20px;
  }

  #printArea h2 {
    font-size: 16pt;
    margin-bottom: 10px;
  }

  #printArea .print-row {
    border-bottom: 1px solid #ccc;
    padding: 10px 0;
  }

  .no-print {
    display: none !important;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}


@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.4s ease;
}

/* Add these styles to your style.css file for enhanced search UX */

/* Search input with icon */
.search-input-container {
  position: relative;
}

.search-input-container input {
  padding-right: 2.5rem;
}

.search-input-container .search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Highlight matching text in dropdown options (advanced) */
.dropdown-option-highlight {
  background-color: #fef3c7;
  font-weight: 500;
}

/* Loading state for search */
.search-loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%23d1d5db' stroke-width='2'/%3E%3Cpath d='M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z' fill='%236366f1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

/* Responsive improvements */
@media (max-width: 640px) {
  .project-search-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .project-search-container input,
  .project-search-container select,
  .project-search-container button {
    width: 100%;
  }
}


/* === Calculator Section Headers (single source of truth) === */
.section-wrapper > h2,
.section-wrapper > h3 {
  background-color: #1fb29d; /* Teal background */
  color: #fff;               /* White text */
  padding: 10px 14px;        /* Space around text */
  margin: 0;                 /* Remove default heading margin */
  border-radius: 6px 6px 0 0;/* Rounded top corners */
  font-weight: 600;          /* Bold text */
  display: flex;             /* If you have icons/actions inside the header */
  align-items: center;
  justify-content: space-between;
}

.section-wrapper > h2 svg,
.section-wrapper > h3 svg {
  color: #fff;
  fill: currentColor;
}
