/* ========================================= */
/* General Styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #f8f9fa;
  color: #343a40;
}

.container {
  width: 80%;
  margin: 0 auto;
  padding-top: 20px;
}

/* Header */
header {
  background-color: #28a745;
  padding: 20px;
  color: white;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
  font-size: 2rem;
}

/* Form */
.search-section {
  padding: 20px 0;
}

.form-group {
  margin-bottom: 15px;
}

label {
  font-weight: bold;
}

.form-control {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  margin-top: 5px;
  border: 1px solid #ced4da;
  border-radius: 5px;
}

.form-buttons {
  margin-top: 20px;
}

.btn {
  background-color: #28a745;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 10px;
}

.btn:hover {
  background-color: #218838;
}

/* Pagination */
#pagination {
  margin-top: 20px;
  text-align: center;
}

#pagination button {
  margin: 0 5px;
}

/* Results Counter */
.total-results {
  margin-top: 20px;
  font-size: 1.2rem;
  font-weight: bold;
}

/* ========================================= */
/* Modal Styling */
#modal {
  display: none;
  position: fixed;
  z-index: 99;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  padding-top: 60px;
}

#modalBody {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  position: relative;
  box-sizing: border-box;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
}

.close:hover {
  color: black;
}

/* Modal Title */
.modal-title {
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  color: #28a745;
  margin-bottom: 15px;
  text-transform: uppercase;
}

/* Holder Details */
#holderDetails {
  font-size: 16px;
  line-height: 1.6;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 10px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

/* Details Table */
.details-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.details-table th, 
.details-table td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

.details-table th {
  background-color: #28a745;
  color: #fff;
  width: 30%;
}

/* ========================================= */
/* Mobile-Friendly Modal Buttons */
.modal-buttons-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

#saveModalBtn,
#copyModalBtn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#copyModalBtn {
  background: #007bff;
}

#saveModalBtn:hover {
  background: #218838;
}

#copyModalBtn:hover {
  background: #0069d9;
}

/* For larger screens – buttons side by side */
@media (min-width: 600px) {
  .modal-buttons-wrapper {
    flex-direction: row;
  }

  #saveModalBtn, #copyModalBtn {
    width: 48%;
  }
}

/* ========================================= */
/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  border-right: 1px solid #ddd;
}

th {
  background-color: #28a745;
  color: white;
}

td:last-child, th:last-child {
  border-right: none;
}

tr:hover {
  background-color: #f1f1f1;
}

/* ========================================= */
/* Responsive Adjustments */
@media (max-width: 600px) {
  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px;
  }

  #modalBody {
    max-width: 400px;
  }
}

/* ========================================= */
/* Dropdown Proper Case */
#stateSelect option,
#companySelect option {
  text-transform: capitalize;
}

/* ========================================= */
/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }

  #modal, #modal * {
    visibility: visible;
  }

  #modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
  }

  #modalBody {
    box-shadow: none;
    border: none;
    width: 100%;
    padding: 10px;
    font-size: 14px;
  }

  .modal-buttons-wrapper {
    display: none;
  }

  @page {
    margin: 10mm;
  }
}
