/* ============================================
   NEW SIDDHIVINAYAK CHS VEHICLE SCANNER
   Professional Access Control Interface
   ============================================ */

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8f9fa;
  color: #202124;
  line-height: 1.5;
  padding: 0;
  min-height: 100vh;
}

/* === 1️⃣ PAGE HEADER (White & Crimson Theme) === */
.page-header {
  background: #ffffff;
  color: #202124;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(220, 20, 60, 0.15);
  border-bottom: 3px solid #dc143c;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-left {
  flex-shrink: 0;
}

.society-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.header-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.header-title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: #dc143c;
  letter-spacing: -0.2px;
}

.header-title .subtitle {
  font-size: 13px;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-weight: 500;
}

.header-title .subtitle i {
  font-size: 14px;
}

/* === 2️⃣ SCANNER CONTAINER === */
.scanner-container {
  padding: 12px;
  background: #ffffff;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

#reader {
  width: 100% !important;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #dc143c;
  box-shadow: 0 4px 16px rgba(220, 20, 60, 0.2);
}

#reader video {
  border-radius: 12px;
  display: block;
  width: 100% !important;
  height: auto !important;
}

/* Scanner Instructions */
.scanner-instructions {
  text-align: center;
  padding: 16px 20px;
  background: #fff5f5;
  border: 2px dashed #dc143c;
  border-radius: 8px;
  margin: 12px;
  color: #5f6368;
}

.scanner-instructions h3 {
  color: #dc143c;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.scanner-instructions h3 i {
  font-size: 18px;
}

.scanner-instructions p {
  font-size: 14px;
  margin: 6px 0;
  line-height: 1.6;
}

.scanner-instructions ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
}

.scanner-instructions li {
  font-size: 13px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.scanner-instructions li i {
  color: #dc143c;
  font-size: 14px;
}

/* === 3️⃣ RESULT CONTAINER === */
.result-container {
  padding: 0 16px 20px 16px;
  animation: fadeIn 0.4s ease-out;
}

/* === STATUS CARDS === */
.status-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.15);
  margin-bottom: 16px;
}

.status-card.access-granted {
  border-left: 6px solid #dc143c;
}

.status-card.access-denied {
  border-left: 6px solid #8b0000;
}

/* === STATUS HEADER === */
.status-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e8eaed;
}

.status-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.access-granted .status-icon {
  background: #dc143c;
  color: #ffffff;
}

.access-denied .status-icon {
  background: #8b0000;
  color: #ffffff;
}

.status-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.access-granted .status-title {
  color: #dc143c;
}

.access-denied .status-title {
  color: #8b0000;
}

/* === VEHICLE INFO === */
.vehicle-info {
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #e8eaed;
}

.info-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5f6368;
  font-weight: 700;
}

.info-value {
  font-size: 16px;
  color: #202124;
  font-weight: 600;
  text-align: right;
}

/* === VEHICLE SECTIONS === */
.vehicle-section {
  background: #f1f3f4;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #dadce0;
}

.vehicle-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #2c3e50;
  font-size: 15px;
  margin-bottom: 10px;
}

.vehicle-section-header i {
  font-size: 20px;
  color: #dc143c;
}

.vehicle-count {
  margin-left: auto;
  background: #dc143c;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}

.vehicle-numbers {
  color: #3c4043;
  font-size: 14px;
  line-height: 1.7;
  padding-left: 30px;
  font-weight: 500;
}

/* === 4️⃣ ACTION BUTTONS === */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.btn i {
  font-size: 18px;
}

.btn-call {
  background: #dc143c;
  color: #ffffff;
}

.btn-call:hover {
  background: #b01030;
}

.btn-danger {
  background: #8b0000;
  color: #ffffff;
}

.btn-danger:hover {
  background: #700000;
}

.btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn:disabled:active {
  transform: none;
}

/* === SCAN AGAIN BUTTON === */
#scanAgain {
  width: calc(100% - 32px);
  max-width: 500px;
  margin: 20px auto;
  display: block;
  padding: 16px 24px;
  background: #dc143c;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220, 20, 60, 0.25);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#scanAgain i {
  margin-right: 8px;
}

#scanAgain:active {
  transform: translateY(1px);
  background: #b01030;
}

/* === 5️⃣ REPORT FORM === */
.report-form-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px 20px;
  margin: 16px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.15);
  border-top: 5px solid #8b0000;
  animation: slideUp 0.3s ease-out;
}

.report-form-container h4 {
  font-size: 20px;
  font-weight: 700;
  color: #8b0000;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-form-container h4 i {
  font-size: 22px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5f6368;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: #ffffff;
  transition: all 0.2s ease;
  color: #202124;
}

.form-control:focus {
  outline: none;
  border-color: #dc143c;
  box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%235f6368' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

/* === FILE INPUT WRAPPER === */
.file-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px dashed #dadce0;
  border-radius: 8px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-input-wrapper:hover {
  border-color: #dc143c;
  background: #fff5f5;
}

.file-input-wrapper i {
  font-size: 24px;
  color: #dc143c;
}

.file-label {
  flex: 1;
  font-size: 14px;
  color: #5f6368;
  font-weight: 500;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

/* === 6️⃣ TOAST NOTIFICATIONS === */
.toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc143c;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(220, 20, 60, 0.4);
  z-index: 1000;
  min-width: 280px;
  max-width: 90%;
  text-align: center;
  transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
  bottom: 24px;
}

.toast.success {
  background: #dc143c;
}

.toast.error {
  background: #8b0000;
}

/* === CHECKING/ERROR STATES === */
.checking-message {
  text-align: center;
  padding: 40px 20px;
  font-size: 16px;
  color: #5f6368;
  font-weight: 600;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.checking-message i {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
  color: #dc143c;
}

.error-message {
  background: #ffffff;
  border: 3px solid #8b0000;
  border-radius: 12px;
  padding: 28px;
  color: #8b0000;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(139, 0, 0, 0.2);
}

.error-message i {
  font-size: 44px;
  margin-bottom: 12px;
  display: block;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === SPINNER ANIMATION === */
.fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === RESPONSIVE === */
@media (min-width: 640px) {
  .scanner-container,
  .result-container,
  .report-form-container,
  #scanAgain {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .action-buttons {
    flex-direction: row;
  }
  
  .btn {
    flex: 1;
  }
  
  .header-title h2 {
    font-size: 21px;
  }
  
  .header-title .subtitle {
    font-size: 14px;
  }
}

/* === OUTDOOR READABILITY ENHANCEMENTS === */
@media (prefers-contrast: high) {
  .page-header {
    border-bottom: 4px solid #dc143c;
  }
  
  .status-icon {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }
  
  .btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }
}

/* === PRINT STYLES === */
@media print {
  body {
    background: white;
  }
  
  .scanner-container,
  .action-buttons,
  .report-form-container,
  #scanAgain {
    display: none;
  }
  
  .page-header {
    position: static;
    background: #ffffff;
    border-bottom: 3px solid #dc143c;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}


.verify-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.verify-box {
  background: #fff;
  padding: 20px;
  width: 90%;
  max-width: 360px;
  border-radius: 14px;
  text-align: center;
}

.verify-box h3 {
  margin-bottom: 6px;
}

.verify-box p {
  font-size: 14px;
  color: #555;
  margin-bottom: 14px;
}

.verify-box input {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 15px;
}

.verify-error {
  margin-top: 8px;
  color: #d32f2f;
  font-size: 14px;
}
