@import url('fonts.css');

body {
  font-family:  'IRANSansFaNum';
  margin: 0 !important;
  background: linear-gradient(100deg, #e0e7ef 0%, #d7f1ef 100%);
  direction: rtl;
}

span.value {
  word-break: break-word; /* For newer browsers */
  overflow-wrap: break-word; /* For older browsers */
  white-space: normal; /* Allows text to wrap */
}
.app-wrap {
  max-width: auto;
  margin: 24px auto;
  background: rgba(255,255,255,0.55);
  border-radius: 20px;
  box-shadow: 0 6px 24px 0 rgba(30,30,50,0.13);
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1.5px solid #e7ecf2;
}
.header {
  background: #50c2c9ee;
  color: #fff;
  padding: 18px 18px 8px 18px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  user-select: none;
}
.tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}
.tab-btn {
  flex: 1;
  padding: 14px 0;
  font-size: 16px;
  background: none;
  border: none;
  font-weight: 700;
  color: #50587a;
  transition: background 0.3s, color 0.2s;
  cursor: pointer;
}
.tab-btn.active {
  color: #00b7b1;
  border-bottom: 2.5px solid #00b7b1;
  background: rgba(0,183,177,0.06);
}
.tab-content-wrap {
  /* min-height: 700px; */
}
.tab-content {
  display: none;
  padding: 0;
  background: none;
}
.tab-content.active {
  display: block;
}
.list-scroll {
  /* max-height: 500px; */
  overflow-y: auto;
  padding: 16px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  scroll-behavior: smooth;
}
.card {
  background: rgba(255,255,255,0.32);
  border-radius: 20px;
  box-shadow: 0 4px 18px #b0bec550;
  backdrop-filter: blur(6px);
  margin: 1rem 0;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .62rem;
  font-family: 'IRANSansFaNum';
  text-align: right;
}

.card-header {
  display: flex;
  gap: .6rem;
  margin-bottom: 0.2rem;
}
.chip {
  background: #f0f2fa; color: #444;
  border-radius: 16px;
  font-size: .98rem;
  padding: 0 9px;
  margin-left: 0;
  font-weight: bold;
}
.chip-blue { background:#006DDA22; color:#2364b6; }
.card-main {
  display:flex;
  gap:0.5rem;
  font-size: 0.98rem;
}
.label {
  font-weight: 600; color:#222;
  min-width: 96px;
}
.value {
  color: #444;
  flex: 1;
  white-space: pre-wrap;
  direction: rtl;
}
.time { color: #6b5; font-family:inherit; letter-spacing:0.1px; }
.card-status {
  margin-top: 0.7rem;
}
.status {
  padding:2px 11px; border-radius:8px;
  font-size:.92rem; font-weight:600;
}
.status-online  { background:#e3f1fa; color:#0051bb; }
.status-synced  { background:#e8f5eb; color:#43a047;}
.status-wait    { background:#fff0ee; color:#b71c1c;}

.spinner {
  display: block;
  margin: 40px auto;
  width: 36px; height: 36px;
  border: 5px solid #e0eeff;
  border-top: 5px solid #00b7b1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
@media (max-width: 520px) {
  .app-wrap { max-width: 100%; margin: 0 0; border-radius: 0;}
  .list-scroll { min-height: 69vw; max-height: 76vh; }
}
.list-scroll {
  /* height: 100vh; */
  height: 100dvh;
  overflow-y: auto;
}


#pageContainer {
  padding: 1% 3%;
}

.input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  outline: none;
  transition: border 0.3s;
  text-align: right;
}

.input-group input:focus {
  border-color: #4e54c8;
}

.input-group label {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  color: #aaa;
  pointer-events: none;
  transition: all 0.3s;
  background: white;
}

.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label {
  top: -0.6rem;
  right: 0.6rem;
  padding: 0 0.25rem;
  font-size: 0.8rem;
  color: #4e54c8;
}

button {
  padding: 0.75rem;
  background: #4e54c8;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
  font-family: 'IRANSansFaNum';
}

button:hover {
  background: #3b40b3;
}

.helper {
  text-align: center;
  margin-top: 1rem;
}

.helper a {
  color: #4e54c8;
  text-decoration: none;
  font-size: 0.9rem;
}

#topbar {
  background-color: #1976d2;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

#topbar button {
  background-color: #ef5350;
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#topbar button:hover {
  background-color: #d32f2f;
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#app {
  display: none;
  /* اول مخفی باشه */
}


#installPrompt {
  display: none;
  padding: 16px;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  margin: 10px;
  border-radius: 5px;
}

#loadingAnimCont {
  height: 200px; 
  position: relative; 
  font-size: large;
}

/* custom loading */

.o-gempt,
.o-ldrpg {
  font-size: 2em;
  color: gray;
  text-align: center;
}

.o-gempt {
  width: 100%;
  max-height: 100%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-height: 50px;
}

@media (max-width: 1280px) {
  .o-gempt {
    font-size: 1.5em;
  }
}

.spinCont {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 3;
  /* background: rgba(242, 240, 240, 0.64); */
  overflow: hidden;

  opacity: 0;
  transition: opacity .7s ease-in;
  transition-delay: .3s;
  display: flex;
  align-items: center;
  height: 100%;
}

.spinCont.on {
  opacity: 1;
}

.spinner {
  margin: 50px auto;
  width: 50px;
  height: 50px;
  position: relative;
  text-align: center;
  -webkit-animation: sk-rotate 2.0s infinite linear;
  animation: sk-rotate 2.0s infinite linear;
}

.dot1,
.dot2 {
  width: 60%;
  height: 60%;
  display: inline-block;
  position: absolute;
  top: 0;
  background-color: #3481e5;
  border-radius: 100%;
  -webkit-animation: sk-bounce 3.0s infinite ease-in-out;
  animation: sk-bounce 3.0s infinite ease-in-out;
}

.dot2 {
  top: auto;
  bottom: 0;
  -webkit-animation-delay: -1.0s;
  animation-delay: -1.0s;
}

@-webkit-keyframes sk-rotate {
  100% {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes sk-rotate {
  100% {
    transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
  }
}

@-webkit-keyframes sk-bounce {

  0%,
  100% {
    -webkit-transform: scale(0.0);
  }

  50% {
    -webkit-transform: scale(1.0);
  }
}

@keyframes sk-bounce {

  0%,
  100% {
    transform: scale(0.0);
    -webkit-transform: scale(0.0);
  }

  50% {
    transform: scale(1.0);
    -webkit-transform: scale(1.0);
  }
}

#custom-confirm-backdrop {
  position: fixed; 
  inset: 0; 
  background: #1118; 
  z-index: 2101;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadein .23s;
}
@keyframes fadein { from{opacity:0} to{opacity:1} }

/* برای آیکون چشمک‌زن */
.blinckicon {
  animation: blink 1.4s steps(1, start) infinite;
}

@keyframes blink {
  0%, 78% { opacity: 1; }
  83%,95% { opacity: 0; }
  100% { opacity: 1; }
}
.custom-confirm-modal {
  background: #fff;
  border-radius: 18px;
  min-width: 260px;
  max-width: 88vw;
  box-shadow: 0 6px 32px #2193b055;
  padding: 2.1rem 1rem 1.3rem 1rem;
  text-align: center;
  font-family: "IRANSansFaNum";
  animation: diagal-pop .18s;
  direction: rtl;
}
@keyframes diagal-pop { 
  0%{transform:scale(.95) translateY(22px); opacity:0}
  100%{transform:none; opacity:1} 
}

.custom-confirm-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.custom-confirm-msg {
  font-size: 1.13rem;
  color: #2055bb;
  margin-bottom: 25px;
  font-weight: 500;
  line-height: 1.6;
}

.custom-confirm-btns {
  display:flex;
  gap: 12px;
  flex-direction: row-reverse;
  justify-content:center;
}
.custom-confirm-btns button {
  flex:1;
  padding: 10px 0;
  margin: 0 2px;
  border: none;
  border-radius: 10px;
  font-size: 1.08rem;
  font-family: inherit;
  font-weight: 700;
  background: linear-gradient(90deg,#2193b0 0,#6dd5ed 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1.5px 9px #197fe855;
  transition: background .15s;
}
.custom-confirm-btns .cancel {
  background: #eef1f7;
  color: #386;
  font-weight: 600;
}
.custom-confirm-btns button:active {
  opacity: 0.76;
}

.form-container {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  margin: 1rem .3rem;
  padding: 1rem .7rem .7rem;
  box-shadow:0 1px 10px #93baff33;
  direction: rtl;
  animation: fadeInUp 0.15s;
}
.form-label { display:block; font-weight:600; margin-bottom: .4rem; }
.form-input {
  width: 100%; min-height: 64px;
  border-radius: 10px;
  padding: .5rem .7rem;
  border: 1.2px solid #e7eaf0;
  background:rgba(233,245,255,.30);
  font-family:'IRANSansFaNum';
  box-sizing: border-box;
  margin-bottom: .7rem;
  font-size: 1.03rem;
  transition: box-shadow .18s;
}
.form-input:focus { border:1.2px solid #1ea8dd; outline:none; box-shadow: 0 0 0 1px #007fff22;}
.btn-glass {
  background: linear-gradient(90deg,#bce6ffab,#d8f4ff80);
  border-radius:14px; border:none;
  color:#1677b3; font-weight:700;
  font-family: inherit;
  padding:6px 24px; font-size:1rem; cursor:pointer;
  box-shadow:0 1px 3px #aee1ff48;
  transition: background .16s;
}
.btn-glass:active {background:#fff; color:#0054a6;}
/* end custom loading */

.operation-card {
  background: rgba(255,255,255,0.34);
  border-radius: 20px;
  box-shadow: 0 6px 32px rgba(60,60,100,0.09);
  margin-bottom: 20px;
  padding: 18px;
  position: relative;
  direction: rtl;
}
.btn-victim-toggle {
  background: rgba(46, 98, 255, 0.15);
  color: #2e62ff;
  border: none;
  border-radius: 12px;
  padding: 7px 17px;
  font-size: 1.1rem;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 1px 10px rgba(40, 90, 200, 0.1);
  transition: background 0.25s;
}

.btn-victim-toggle:hover {
  background: rgba(46, 98, 255, 0.3);
}

.victim-form-container {
  width: 100%;
  padding: 0;
  margin: 0;
}

.victim-form-card {
  background: rgba(250, 255, 255, 0.59);
  border-radius: 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
  padding: 20px 10px;
  margin-top: 5px;
  animation: fadeInVictim 0.33s;
  border: 1px solid rgba(83, 132, 255, 0.05);
  direction: rtl;
  font-family: inherit;
  width: 100%; /* اطمینان از اینکه عرض فرم 100% باشه */
  box-sizing: border-box; /* برای اینکه padding و border به عرض اضافه نشن */
}

@keyframes fadeInVictim {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.victim-field {
  width: 100%;
  margin-bottom: 12px;
}

.victim-field label {
  font-weight: 600;
  margin-bottom: 3px;
  display: block;
}

.victim-field input,
.victim-field select,
.victim-field textarea {
  width: 100%;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid #ececec;
  margin-top: 2px;
  background: rgba(255, 255, 255, 0.81);
  font-size: 1rem;
  box-sizing: border-box; /* برای اینکه padding و border به عرض اضافه نشن */
}

.victim-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 9px;
}

@media (max-width: 700px) {
  .victim-row {
    flex-direction: column;
    gap: 6px;
  }
}

.victim-injuries-row {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 7px;
}

.victim-injuries-row select {
  padding: 4px 10px;
  border-radius: 8px;
}

.victim-remove-injury {
  color: #ff4444;
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
}

.victim-form-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.victim-chip {
  display: inline-block;
  background: #3491ff16;
  color: #2e62ff;
  border-radius: 13px;
  padding: 4px 14px;
  font-size: 0.97rem;
  margin-left: 4px;
  margin-right: 2px;
}

.victim-form-container {
  width: 100%;
  padding: 0;
  margin: 0;
}

.victim-form-card {
  background: rgba(250, 255, 255, 0.59);
  border-radius: 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
  padding: 20px 10px;
  margin-top: 5px;
  animation: fadeInVictim 0.33s;
  border: 1px solid rgba(83, 132, 255, 0.05);
  direction: rtl;
  font-family: inherit;
  width: 100%; /* تغییر به auto */
  max-width: 100%; /* اضافه کردن max-width */
  box-sizing: border-box; /* برای اینکه padding و border به عرض اضافه نشن */
}

.button-container {
  /* This is to help visualize the container, not strictly necessary for layout */
  overflow: hidden; /* Clears floats if you were to use them */
}

.button-wrapper {
  display: inline-block; /* This is the key property */
  vertical-align: top; /* Aligns the wrappers at the top */
  margin-right: 1rem; /* Adds spacing between the button groups */
}

/* Optional: If you want to remove the gap on the last item */
.button-container .button-wrapper:last-child {
  margin-right: 0;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.action-card {
  flex: 1 1 30%;
  background: #f4f6f8;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.action-card i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #007bff;
}

.action-card:hover {
  background-color: #e0f0ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-card span {
  font-size: 0.9rem;
  color: #333;
}

.autocomplete-wrapper {
      max-width: 400px;
      margin: 2rem auto;
      display: flex;
      flex-direction: column;
      font-family: sans-serif;
    }

    .autocomplete-wrapper label {
      margin-bottom: 0.5rem;
      font-weight: bold;
      color: #333;
    }

    #city-search {
      padding: 0.5rem;
      font-size: 1rem;
      border: 2px solid #007bff;
      border-radius: 6px;
      outline: none;
      transition: border-color 0.3s;
    }

    #city-search:focus {
      border-color: #0056b3;
    }

    .awesomplete ul {
      border-radius: 6px;
      border: 1px solid #ccc;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
      background: white;
    }

    .awesomplete li {
      padding: 0.5rem;
      cursor: pointer;
    }

    .awesomplete li[aria-selected="true"] {
      background-color: #007bff;
      color: white;
    }

* {
  box-sizing: border-box;
  
}

input , select {
    font-family: 'IRANSansFaNum';
}

.media-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,0.5);
  direction: rtl;
  font-family: 'IRANSansFaNum';
}

.media-modal-content {
  background: #fff;
  width: 95%;
  max-width: 500px;
  margin: 5% auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  animation: media-fade-in 0.3s ease;
}

@keyframes media-fade-in {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.media-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #004080;
  color: white;
  padding: 12px 16px;
}

.media-modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.media-modal-close {
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
}

.media-modal-body {
  padding: 16px;
}

.media-modal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.media-modal-buttons button {
  flex: 1 1 30%;
  padding: 10px;
  border: none;
  background-color: #0066cc;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.media-modal-buttons button:hover {
  background-color: #004c99;
}

.media-modal-list {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.media-modal-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: #f9f9f9;
}

.media-modal-item img,
.media-modal-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-modal-item .media-modal-delete {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

 .hidden {
    display: none;
  }

  .visible {
    display: block;
    animation: fadeIn 0.3s;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }


  .accordion {
    width: 300px;
  }

  .toggleButton {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
  }

  .toggleButton:hover {
    background-color: #2980b9;
  }

  .collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 8px;
    padding: 0 12px;
    display: none;
  }

  .collapsible.open {
    max-height: 500px;
    padding: 12px;
    display: block;
  }

  .alert {
    margin: 6px 0;
    padding: 8px;
    background: #eee;
    border-radius: 4px;
  }

  .form-content {
   display: none;
  }

  .form-content.active {
   display: block;
  }

  h1,h2,h3,h4,h5,h6 
  {
     font-family: 'IRANSansFaNum';
  }

  #refreshBtn {
    background-color: #00d3ff !important;
    left: 1px !important;
  }