/* ------------------------------
   GLOBAL RESET & VARIABLES
--------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

:root {
  --primary: #1E4BD1;
  --muted: #6b7280;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 12px;
}

/* PAGE BASE */
body {
  background: var(--bg);
  padding: 25px;
}

.container {
  max-width: 900px;
  margin: auto;
}

/* HERO HEADER */
.hero {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.subtitle {
  color: var(--muted);
  margin-bottom: 16px;
}

/* SEARCH FORM */
.search-card {
  background: white;
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.single-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  font-size: 14px;
  font-weight: 700;
}

input, select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #dce1eb;
  font-size: 15px;
}

.btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: white;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.msg {
  text-align: center;
  color: #b91c1c;
}

/* RESULT PAGE */
.photo-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto 20px auto;    /* center + bottom space */
  height: 260px;               /* fixed height so it never shifts */
}
.photo-wrapper img {
  width: 260px;
  height: 260px;
  border-radius: 12px;
  object-fit: cover;
  object-position: top;        /* crop only from bottom */
  background: #fff;
  display: block;
  margin: auto;
}

/* Mobile size */
@media(max-width:800px) {
  .photo-wrapper {
    height: 150px;             /* match the image size */
  }
  .photo-wrapper img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    object-position: top;      /* crop only from bottom on mobile */
    background: #fff;
    display: block;
    margin: auto;
  }
}

/* FILTER PANEL */
.filters-panel {
  background: white;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* GRID LAYOUT */
.results-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  padding: 10px 5px;
}
@media (max-width: 600px) {
  .results-section {
    justify-items: center;
    justify-content: center;
    grid-template-columns: repeat(auto-fit, minmax(320px, max-content));
  }
}

/* ------------------------------
   RESULT CARD — FIXED HEIGHT
--------------------------------*/
.result-card {
  background: white;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 260px;              /* 🔥 FIXED HEIGHT */
  overflow: hidden;           /* Prevent layout movement */
}

/* FIX PROFILE AREA */
.profile-left {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-height: 80px;           /* 🔥 FIXED HEIGHT */
  max-height: 80px;
  overflow: hidden;
}

/* AVATAR */
.profile-circle {
  width: 55px;
  height: 55px;
  background: #1E4BD1;
  color: white;
  border-radius: 50%;
  font-size: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
}

/* NAME */
.mar-name {
  font-size: 18px;
  font-weight: 800;
  overflow: hidden;
}
.eng-name {
  font-size: 15px;
  color: #475569;
  margin-top: 4px;
  overflow: hidden;
}

/* CHIPS */
.chips { 
  display: flex; 
  gap: 8px; 
  margin-top: 8px; 
}
.chip {
  background: #e7efff;
  color: #1E4BD1;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* INFO BOX */
.info-box {
  background: #f8fafc;
  padding: 12px 16px;
  border-left: 4px solid #1E4BD1;
  border-radius: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.info-title {
  font-size: 13px;
  color: #475569;
}

.info-value {
  font-size: 15px;
  font-weight: 700;
}

/* VERIFY BUTTON */
.verify-big-btn {
  padding: 14px;
  background: #1E4BD1;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
}

/* ------------------------------
     NO RESULT BOX
--------------------------------*/
.no-result-box {
  background: #fff7ed;
  border-left: 4px solid #f59e0b;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

/* ------------------------------
       FIXED BOTTOM MODAL
--------------------------------*/
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: flex-end;    /* 🔥 FIXED BOTTOM */
  padding: 20px;
  z-index: 2000;
}

.modal {
  background: white;
  padding: 28px;
  border-radius: 16px 16px 0 0;   /* Rounded top only */
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.3);
}

.modal h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.modal input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

/* ------------------------------
             TOAST
--------------------------------*/
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #059669;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  display: none;
  z-index: 3000;
}

/* ------------------------------
         RESPONSIVE
--------------------------------*/
@media(max-width:800px) {
  .results-section { gap: 16px; }
  .profile-circle { width: 48px; height: 48px; font-size: 22px; }
  .photo-wrapper img { width: 150px; height: 150px; object-fit: cover; object-position: top; background: #fff; display: block; margin: auto; }
}

@media (max-width: 600px) {
  .results-section {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}
@media (max-width: 600px) {
  body {
    padding: 0;
  }
  .container {
    padding: 0;
  }
}
