/* ========== GLOBAL ========== */
body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #393440;
  margin: 0;
}

h3 {
  margin-bottom: 20px;
  color: #4326e8;
}

/* ========== FORM & INPUT ========== */
label {
  font-weight: 600;
  margin-bottom: 5px;
}

input[type="file"],
select.form-select,
input[type="number"],
input[type="date"] {
  max-width: 90%;
  margin-bottom: 10px;
}

button {
  min-width: 120px;
  transition: all 0.2s ease-in-out;
}

button:hover {
  transform: scale(1.02);
}

/* ========== PREVIEW IMAGE ========== */
#previewImg,
#modalCropImage {
  border: 2px dashed #7d6c6c;
  padding: 6px;
  background-color: #fff;
  max-width: 100%;
  max-height: 400px;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

/* ========== RESULT PREVIEW TABLE ========== */
#preview img {
  border: 2px solid #28a745;
  padding: 4px;
  border-radius: 6px;
  margin-bottom: 8px;
  max-width: 50%;
}

#preview a {
  display: inline-block;
  margin-top: 6px;
}

/* ========== IMAGE CARD GRID ========== */
.card {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #0872dd;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
}

.card img {
  width: 100%;
  height: auto;
}

.card-body {
  padding: 10px;
  font-size: 14px;
  text-align: center;
}

.card-body small,
.card-body div {
  color: #555;
}

/* ========== NAVBAR ========== */
.navbar-brand {
  font-weight: bold;
  font-size: 20px;
}

.navbar .nav-link.active {
  font-weight: bold;
  color: #ffc107 !important;
}
.custom-navbar {
  background: linear-gradient(to right, #0066cc, #236ccb);
}
.custom-navbar .navbar-brand,
.custom-navbar .nav-link {
  color: #ffffff !important;
}
.custom-navbar .nav-link:hover {
  color: #eaff07 !important;
}

/* ========== MODAL ========== */
.modal .modal-body img {
  max-height: 450px;
  object-fit: contain;
}

/* ========== TABLE PREVIEW ========== */
.table th,
.table td {
  vertical-align: middle;
  text-align: center;
}

.table th {
  background-color: #e9f6ed;
}

/* ========== A4 PRINT LAYOUT ========== */
.a4-sheet {
  width: 210mm;
  height: 297mm;
  padding: 10mm;
  background: white;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: var(--gap-size, 8px);
  page-break-after: always;
  box-sizing: border-box;
  position: relative;
}

.photo-box {
  border: 1px dashed #000;
  overflow: hidden;
  box-sizing: border-box;
}

.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-border {
  border: none !important;
}

/* ========== PRINT MODE ========== */
@media print {
  html, body {
    width: 210mm;
    height: 297mm;
    background: white;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }

  .a4-sheet {
    width: 210mm;
    height: 297mm;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gap-size, 8px);
    page-break-after: always;
    box-sizing: border-box;
  }

  .print-area {
    padding: 10mm;
    page-break-after: always;
  }

  .photo-box img {
    page-break-inside: avoid;
  }
}

/* ========== FORM CONTAINERS ========== */
.filter-box,
.print-settings,
.image-selection {
  border: 1px solid #dee2e6;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  background: #f8f9fa;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  #previewImg,
  #modalCropImage {
    max-height: 250px;
  }

  .card-body,
  .form-label,
  .form-check-label {
    text-align: center;
  }

  button,
  select,
  input[type="file"],
  input[type="number"],
  input[type="date"] {
    width: 100% !important;
  }
}
