/* Color Palette */
:root {
  --primary-color: #ED5506; /* Orange */
  --secondary-color: #F78B00; /* Lighter Orange */
  --accent-color: #00285F; /* Dark Blue */
  --text-light: #FFFFFF; /* White */
  --text-dark: #333333;
  --background-light: #FFFFFF;
  --background-grey: #f4f4f4;
  --border-color: #ddd;
}

body {
  padding: 0;
  margin: 0;
  font: 16px "Lucida Grande", Helvetica, Arial, sans-serif;
  background-color: var(--background-grey);
  color: var(--text-dark);
}

a {
  color: var(--primary-color);
  text-decoration: none;
}
a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-light);
}
.btn-primary:hover {
  background-color: var(--secondary-color);
  color: var(--text-light);
}

.btn-secondary {
  background-color: var(--accent-color);
  color: var(--text-light);
}
.btn-secondary:hover {
  background-color: #00408a; /* Slightly lighter blue */
  color: var(--text-light);
}

.btn-outline {
  background-color: var(--primary-color); /* Changed to lighter orange */
  color: var(--text-light); /* Kept text white */
  border: 1px solid var(--primary-color); /* Match border to background */
}
.btn-outline:hover {
  background-color: var(--secondary-color); /* Darker orange (primary) on hover */
  color: var(--text-light);
  border-color: var(--secondary-color); /* Match border to hover background */
}

.btn-logout {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 8px 15px;
}
.btn-logout:hover {
    background-color: var(--secondary-color);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-details {
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: none;
}
.btn-details:hover {
    background-color: var(--primary-color);
}


/* --- Login Page --- */
.login-container {
  max-width: 400px;
  margin: 50px auto;
  padding: 30px;
  background-color: var(--background-light);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-container h1 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.login-container h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--accent-color);
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-sizing: border-box; /* Include padding in width */
}

.error-message {
  color: #d9534f; /* Red for errors */
  background-color: #f2dede;
  border: 1px solid #ebccd1;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
}

/* --- Dashboard --- */
.dashboard-header {
  background-color: var(--accent-color);
  color: var(--text-light);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between search and logout */
}

.search-form {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.dashboard-content {
  padding: 30px;
}

.dashboard-content h2 {
    color: var(--accent-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Additions for Filter Buttons */
.section-header {
    display: flex;
    justify-content: space-between; /* Pushes h2 and filter buttons apart */
    align-items: center; /* Vertically align items */
    margin-bottom: 20px; /* Keep the margin below the header */
    border-bottom: 2px solid var(--primary-color); /* Move border here */
    padding-bottom: 10px; /* Move padding here */
}

.section-header h2 {
    margin: 0; /* Remove default margin */
    border: none; /* Remove border from h2 itself */
    padding: 0; /* Remove padding from h2 itself */
}

.filter-buttons {
    display: flex;
    gap: 10px; /* Space between filter buttons */
}

.btn-filter {
    background-color: var(--background-grey); /* Default state - inactive */
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-filter.active {
    background-color: var(--accent-color); /* Active state */
    color: var(--text-light);
    border-color: var(--accent-color);
}

.btn-filter:hover:not(.active) {
    background-color: #e0e0e0; /* Light hover for inactive buttons */
}
/* End Additions */

/* --- Additional Filters --- */
.additional-filters {
    background-color: var(--background-light);
    padding: 15px 30px;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Space between filter groups */
    align-items: flex-end; /* Align items to the bottom */
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column; /* Stack label and input vertically */
    gap: 4px;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: bold;
}

.filter-group input[type="date"],
.filter-group input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto; /* Push actions to the right if space allows */
    padding-bottom: 2px; /* Align button bottom with input bottom */
}

/* --- Inspections Table --- */
.inspections-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: var(--background-light);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.inspections-table th,
.inspections-table td {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.inspections-table th {
  background-color: var(--accent-color);
  color: var(--text-light);
  font-weight: bold;
}

.inspections-table tbody tr:nth-child(even) {
  background-color: var(--background-grey);
}

.inspections-table tbody tr:hover {
  background-color: #e9e9e9;
}

/* --- Pagination --- */
.pagination {
  margin-top: 20px;
  text-align: center;
}

.btn-pagination {
  margin: 0 3px;
  background-color: var(--background-light);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn-pagination.active,
.btn-pagination:hover {
  background-color: var(--accent-color);
  color: var(--text-light);
}

.btn-pagination:disabled {
    background-color: var(--accent-color);
    color: var(--text-light);
    opacity: 0.7;
    cursor: not-allowed;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background-color: var(--background-light);
    color: var(--text-dark);
    border-top: 1px solid var(--border-color);
}

footer p {
    color: #777;
}

/* --- Inspection Details Modal --- */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.6); /* Black w/ opacity (overlay) */
}

.modal-content {
  background-color: var(--background-light);
  margin: 10% auto; /* 10% from the top and centered */
  padding: 30px;
  border: 1px solid var(--border-color);
  width: 80%; /* Could be more or less, depending on screen size */
  max-width: 700px; /* Maximum width */
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* The Close Button */
.close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
}

.close-button:hover,
.close-button:focus {
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
}

#modal-body {
    margin-top: 20px;
}

/* Add styles for content inside the modal body as needed */
#modal-body p {
    margin-bottom: 10px;
    line-height: 1.6;
}
#modal-body strong {
    color: var(--accent-color);
}

/* Styling for the list of damages */
.damage-list {
    list-style: none;
    padding-left: 0; /* Remove default list indentation */
    margin-top: 15px;
}

.damage-list li {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 10px;
}

.damage-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Style for individual damage images within the modal list */
.damage-detail-image {
    display: block; /* Prevents extra space below image */
    max-width: 100%;   /* Scale down to fit container width */
    max-height: 250px; /* Limit maximum height */
    height: auto;     /* Maintain aspect ratio */
    margin-top: 10px; /* Add some space above the image */
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Style for the damage diagram image */
.damage-diagram-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Container for the diagram (optional, for potential centering/styling) */
.damage-diagram-container {
    margin-bottom: 15px;
}


/* Pagination ellipsis */
.pagination-ellipsis {
    padding: 0 5px;
    color: #777;
}

/* --- Reports Grid --- */
.charts-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.chart-card {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
}
