/* =========================================================
   RESPONSIVE.CSS
========================================================= */


/* ================= GLOBAL RESET ================= */

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body{
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

img,
video,
canvas,
svg{
  max-width: 100%;
  height: auto;
  display: block;
}

input,
textarea,
select,
button{
  font-family: inherit;
}

table{
  width: 100%;
  border-collapse: collapse;
}


/* ================= DESKTOP NAV FIX ================= */

.hamburger{
  display: none;
}


/* ================= LARGE TABLETS ================= */

@media screen and (max-width: 992px){

  .container{
    width: 95% !important;
    padding: 15px !important;
  }

  .header{
    gap: 10px;
  }

}


/* ================= TABLETS + MOBILE ================= */

@media screen and (max-width: 768px){

  body{
    overflow-x: hidden;
    padding: 0;
  }

  /* ================= CONTAINER ================= */

  .container{
    width: 100% !important;
    max-width: 100% !important;
    margin: 75px auto 20px auto !important;
    padding: 12px !important;
    overflow-x: hidden;
  }


  /* ================= NAVBAR ================= */

  nav{
    width: 100%;
    padding: 12px 14px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
  }

  .logo{
    font-size: 1.2rem !important;
    white-space: nowrap;
  }

  /* ================= HAMBURGER ================= */

  .hamburger{
    display: block;
    font-size: 24px;
    cursor: pointer;
    color: white;
    z-index: 1001;
  }

  /* ================= MOBILE MENU ================= */

  .nav-links{
    display: none;
    flex-direction: column;
    width: 100%;
    background: #0f172a;
    padding: 12px 0;
    margin-top: 10px;
    border-radius: 12px;
    gap: 0 !important;
  }

  .nav-links.active{
    display: flex;
  }

  .nav-links li{
    width: 100%;
    text-align: center;
    list-style: none;
  }

  .nav-links a{
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 14px;
    text-decoration: none;
  }


  /* ================= HEADERS ================= */

  .header{
    display: flex;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
    margin-bottom: 15px;
  }

  .header h1{
    font-size: 1.7rem;
  }

  .header h2{
    font-size: 1.4rem;
  }

  .header h3{
    font-size: 1.2rem;
  }


  /* ================= FORMS ================= */

  form{
    width: 100%;
  }

  input,
  textarea,
  select,
  button{
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    box-sizing: border-box;
  }

  textarea{
    min-height: 100px;
    resize: vertical;
  }

  button{
    cursor: pointer;
  }


  /* ================= TABLES ================= */

  table{
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  th,
  td{
    padding: 10px;
  }


  /* ================= CARDS ================= */

  .card,
  .panel,
  .section-card{
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
  }


  /* ================= PATIENT CARD ================= */

  .patient-card-row{
    width: 100%;
    display: flex;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }

  .patient-actions{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .patient-actions button{
    flex: 1 1 45%;
    min-width: 120px;
  }


  /* ================= BUTTON GROUPS ================= */

  .button-group{
    display: flex;
    flex-direction: column;
    gap: 10px;
  }


  /* ================= TABS ================= */

  .tabs{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .tab{
    flex: 1 1 45%;
    text-align: center;
  }


  /* ================= SEARCH RESULTS ================= */

  #searchResults{
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    margin-top: 5px;
  }


  /* ================= MODALS ================= */

  .modal,
  .popup,
  .dialog{
    width: 95% !important;
    max-width: 95% !important;
    margin: auto;
  }


  /* ================= FLEX FIXES ================= */

  .row{
    flex-direction: column !important;
  }

  .col{
    width: 100% !important;
  }

}


/* ================= SMALL MOBILE ================= */

@media screen and (max-width: 576px){

  body{
    padding: 0;
  }

  .container{
    width: 100% !important;
    margin: 70px auto 15px auto !important;
    padding: 10px !important;
  }


  /* ================= NAV ================= */

  nav{
    padding: 10px !important;
  }

  .logo{
    font-size: 1rem !important;
  }

  .nav-links a{
    font-size: 13px;
    padding: 12px;
  }


  /* ================= TEXT ================= */

  .header h1{
    font-size: 1.5rem;
  }

  .header h2{
    font-size: 1.2rem;
  }

  .header h3{
    font-size: 1rem;
  }

  p,
  span,
  label{
    font-size: 14px;
  }


  /* ================= FORMS ================= */

  input,
  textarea,
  select{
    font-size: 14px;
    padding: 10px;
  }

  button{
    padding: 12px;
    font-size: 14px;
  }


  /* ================= ACTION BUTTONS ================= */

  .patient-actions button{
    flex: 1 1 100%;
  }


  /* ================= TABS ================= */

  .tab{
    flex: 1 1 100%;
    padding: 10px;
  }


  /* ================= TABLE FIX ================= */

  table{
    font-size: 13px;
  }

}


/* ================= EXTRA SMALL DEVICES ================= */

@media screen and (max-width: 380px){

  .logo{
    font-size: 0.9rem !important;
  }

  .header h1{
    font-size: 1.3rem;
  }

  .header h2{
    font-size: 1.1rem;
  }

  .container{
    padding: 8px !important;
  }

  input,
  textarea,
  select,
  button{
    font-size: 13px;
  }

}


/* ================= SAFETY FIXES ================= */

.card,
.panel,
.section-card,
.container,
.row,
.col,
nav,
header,
main,
footer{
  max-width: 100%;
}

pre,
code{
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.long-text,
.break-text{
  word-wrap: break-word;
  overflow-wrap: break-word;
}
