/******* COLORI *******/
:root {
  --main-bg-color: #ffffff;
  --second-bg-color: #f6f7f8;
  --primary-color: #006723;
  --primary-color-hover: #014016;
  --header-border-color: #dee1e6;
  --border-color: #e5e7eb;
}

/******* SETTINGS GLOBALI *******/
* {
  border: 0;
  margin: 0;
}
body {
  font-family: "Lexend", sans-serif;
}
main {
  box-sizing: border-box;
  padding: 1em 1em 6em 1em;
  background-color: var(--second-bg-color);
}
section {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 3rem;
}

button {
  border-radius: 0.5rem;
  width: 6.5rem;
  font-size: 0.9rem;
  height: 2.5rem;
  margin-top: 1rem;
  transition: background-color 0.2s, color 0.5s, border 0.2s;
  cursor: pointer;
  font-family: inherit;
}
button:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.6;
}
::placeholder {
  color: #5e5e5e;
  opacity: 1;
}
a:link {
  color: var(--primary-color);
}
a:visited {
  color: #870058;
}
.material-symbols-outlined {
  font-size: 27px;
  color: var(--primary-color);
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.grid {
  gap: 1em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16em, 1fr));
  padding: 1em 0em 0em 0em;
  justify-content: center;
}
.grid-4c {
  gap: 1rem;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, 18.165rem);
  width: 100%;
  justify-content: center;
}

.grid-dintorni {
  gap: 1rem;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, 18.165rem);
  width: 100%;
  justify-content: center;
}

.sr-only {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.row-btn {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}
.row-btn:has(> *:only-child) {
  justify-content: center;
}

/*VALIDAZIONE INPUT FORM*/
/* Campo con errore */
input.invalid,
select.invalid,
textarea.invalid {
  border: 2px solid #c62828;
  background-color: #fff;
  outline-color: #c62828;
}

input.invalid:focus,
select.invalid:focus,
textarea.invalid:focus {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

/* Messaggio errore sotto il campo */
.error-message {
  display: none;
  color: #b71c1c;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: #ffebee;
  border-left: 4px solid #c62828;
  border-radius: 4px;
}

.error-message:not(:empty) {
  display: block;
}

/* Errore generale in cima al form */
.general-error {
  display: none;
  color: #b71c1c;
  background-color: #ffebee;
  border: 2px solid #c62828;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.general-error:not(:empty) {
  display: block;
}

/* Messaggio successo */
.success-message {
  display: none;
  color: #1b5e20;
  background-color: #e8f5e9;
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.success-message:not(:empty) {
  display: block;
}

.row-btn:has(> *:only-child) {
  justify-content: flex-end;
}

h1 {
  text-align: center;
  font-size: 1em;
  margin-bottom: 0.5em;
  color: black;
}
h2 {
  font-size: 2em;      
  margin-top: 0;        
  line-height: 1.2;     
  margin-bottom: 1rem;  
  text-align:center;
}
h3 {
    font-family: inherit; 
    margin: 0.1em 0 0.2em 0;
    line-height: 1.2;
}
.title-main {
    font-size: 1em;    
    text-align: center;
    width: 100%;
    display: block;
}
.title-card {
    font-size: 1.5em;
    text-align: left;
}
p {
  font-family: inherit;
  line-height: 1.5; 
  margin-bottom: 0.5em; 
}
h1 {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 0.5em
}
h1 + p {
  text-align: center;
  max-width: 800px;       
  margin: 0 auto 1em auto;
  font-size: 1.2em;
  padding: 0 1em;        
}
.form-search-container {
  display: flex;
  gap: 0.5rem;             
  width: 100%;             
  max-width: 700px;       
  margin: 2rem auto;       
  padding: 0 1rem;         
  box-sizing: border-box;
  align-items: center;
}
.form-search-container input[type="search"] {
  flex-grow: 1;            
  height: 3rem;
  font-size: 1rem;
  border-radius: 1rem;
  border: 1px solid black; 
  padding-left: 1rem;
  box-sizing: border-box; 
}
.form-search-container button {
  width: 10rem;            
  height: 3rem;
  background-color: var(--primary-color);
  color: var(--main-bg-color);
  font-weight: bold;
  font-size: 1rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  margin: 0;
}
.form-search-container button:hover {
  background-color: var(--primary-color-hover);
}
.hero-image {
  display: block;        
  margin: 2em auto;     
  
  width: 65%;
  border-radius: 1rem;
}
/**********************/
/*       HEADER       */
/**********************/

.main-header {
  height: 4rem;
  position: sticky;
  display: flex;
  background-color: var(--main-bg-color);
  top: 0;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--header-border-color);
  z-index: 1000;
  padding-right: 1rem;
}
/**********************/
/*       NAVBAR       */
/**********************/
.Top-NavBar a {
  height: 2rem;
  text-decoration: none;
  padding: 0.5rem;
  color: black;
  border-radius: 1rem;
  border: 2px solid transparent;
  transition: border 0.2s, color 0.2s, background-color 0.3s;
}
.Top-NavBar a:hover {
  border: var(--primary-color) solid 2px;
  background-color: var(--primary-color);
  border-radius: 1rem;
  color: var(--main-bg-color);
}
.Top-NavBar a:hover a:visited {
  color: inherit;
}
.Top-NavBar ul {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  display: none;
  flex-direction: column;
  background-color: #fff;
  z-index: 1000;
}
.Top-NavBar .current-page {
  pointer-events: none;
  padding: 0.5rem;
  border: var(--primary-color) solid 2px;
  background-color: var(--primary-color);
  border-radius: 1rem;
  color: var(--main-bg-color);
}
/* BREADCRUMB */
#breadcrumb {
  display: block;
  padding: 0.8em 1em;
  font-size: 1em;
  text-align: left;
  background-color: var(--second-bg-color);
}
#breadcrumb a {
  color: var(--primary-color);
  text-decoration: underline;
}

h1.hide {
  background-image: url("../h1.webp");
  margin-left: 1rem;
  margin-top: 1rem;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: contain;
}
/******* MENU HAMBURGER *******/
.menu-toggle {
  display: block;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}
.Top-NavBar ul.open {
  display: flex;
}

.Top-NavBar li {
  padding: 1rem;
  border-bottom: 1px solid #ddd;
}
/**********************/
/*        HOME        */
/**********************/

.hero-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2rem;
  background-color: var(--second-main-bg-color);
  border-radius: 20px;
}
.hero-section img {
  border-radius: 20px;
  height: auto;
  object-fit: cover;
  width: 100%;
}

#hero-section-div {
  margin: 1.5em;
  flex: 1;
  min-width: 0;
}
#hero-section-div h1 {
  font-size: 2em;
}
#hero-section-div p {
  margin-top: 2em;
  font-size: 1em;
}
#hero-section-div form {
  margin-top: 4em;
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

#hero-section-div input {
  font-size: 1em;
  width: 100%;
  height: 3em;
  border-radius: 1em;
  border: black solid 1px;
  padding-left: 1em;
  box-sizing: border-box;
}

#hero-section-div form button {
  height: 3.6em;
  color: var(--main-bg-color);
  border-radius: 1em;
  box-sizing: border-box;
  background-color: var(--primary-color-button);
  cursor: pointer;
}
#hero-section-div form button span {
  font-size: 1.2em;
  font-weight: 600;
}
#hero-section-div div {
  margin-top: 2em;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

#search-drug-button {
  border: var(--primary-color) solid 2px;
  background-color: var(--main-bg-color);
  font-weight: 600;
  font-size: 0.9em;
  color: var(--primary-color-button);
  border-radius: 1em;
  height: 3.6em;
  cursor: pointer;
}
#open-farma-button {
  border: rgba(0, 0, 0, 0.055) solid 1px;
  font-weight: 600;
  font-size: 0.9em;
  color: black;
  border-radius: 1em;
  height: 3.6em;
  cursor: pointer;
}

section:not(.hero-section) {
  margin-top: 3rem;
}
section h1,
section h2 {
  margin-top: 3rem;
  text-align: center;
}
section h2 {
  font-size: 2em;
}
.grid {
  margin-top: 4rem;
  gap: 2rem;
  display: grid;
  grid-template-columns: auto;
}

.grid div {
  display: flex;
  height: 12em;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1em;
  border-radius: 1em;
  /* width: 20rem; */
  background-color: var(--second-main-bg-color);
}
#about-grid div h3,
#team-grid div h3,
.grid div h3 {
  font-weight: 500;
  font-size: 1.4em;
  margin: 0.4em 0 1em 0;
}

i {
  margin: 1em;
  color: var(--primary-color);
}

/******* ABOUT US *******/
#about-hero {
  padding: 2rem;
  gap: 2rem;
  margin: 5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
}
#about-hero h1 {
  font-size: 3em;
  text-align: center;
}
#about-hero p {
  text-align: center;
}

#about-hero img {
  width: 65%;
  border-radius: 1em;
}
#about-section {
  margin-top: 0rem;
}
#about-section h1,
#about-section h2 {
  margin-top: 3rem;
  text-align: center;
}
section h2 {
  font-size: 2em;
}
#about-grid,
#team-grid {
  margin-top: 4rem;
  gap: 2rem;
  display: grid;
  grid-template-columns: auto;
}
#team-grid {
  grid-template-columns: auto;
}
#about-grid div {
  display: flex;
  height: 12em;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1em;
  border-radius: 1em;
  /* width: 20rem; */
  background-color: var(--second-main-bg-color);
}
#team-section {
  margin-top: 5rem;
}

.avatar-container {
  border-radius: 12px;
  width: 180px;
  height: 220px;
  padding: 1.5rem;
  text-align: center;
  border: var(--primary-color-button) solid 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
    color 0.5s ease;
  box-shadow: 0px 9px 5px var(--accent);
}
.avatar-container span {
  font-size: 1.3em;
  color: black;
  transition: color 0.2s;
}

.avatar-container:hover {
  transform: translateY(2px);
  background-color: var(--primary-color-button);
  color: var(--main-bg-color);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.2);
}
.avatar-container:hover span {
  color: var(--main-bg-color);
}
.avatar-container a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

/******* FOOTER *******/
footer {
  margin-top: 5rem;
  padding: 5rem;
  display: grid;
  grid-template-columns: auto;
  justify-content: center;
  gap: 2rem;
  text-align: center;
  border-top: 2px solid var(--header-border-color);
}
footer img {
  width: 3rem;
}


/******* AREA PERSONALE *******/
.page-wrapper {
  flex-direction: column;
  height: auto;
}

.sidenav {
  width: 100%;
  padding: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.sidenav ul {
  flex-direction: row;
  justify-content: space-around;
  gap: 0.5rem;
  overflow-x: auto;
}

.sidenav a {
  flex-direction: column;
  padding: 0.5rem;
  min-width: 4rem;
  text-align: center;
  font-size: 0.85rem;
  gap: 0.3rem;
}

.sidenav .material-symbols-outlined {
  font-size: 24px;
}

.main-area-personale {
  width: 100%;
  padding: 1rem;
}

li.logout {
  margin-top: 0;
}

/******* NOTIFICATIONS *******/
.notification {
  top: 1rem;
  right: 1rem;
  left: 1rem;
  min-width: auto;
  max-width: none;
  font-size: 0.9rem;
}

.notification .material-symbols-outlined {
  font-size: 24px;
}

/* Auth required message responsive */
.auth-required-message {
  margin: 2em 1em;
  padding: 2em 1.5em;
}

.auth-required-message h2 {
  font-size: 1.5em;
}

.auth-required-message p {
  font-size: 1em;
}

.auth-required-message .btn-primary {
  padding: 0.7em 1.5em;
  font-size: 1em;
}

/**********************/
/*     MED-SEARCH     */
/**********************/

.drug-row { 
  flex-direction: column; 
  align-items:center; 
}

.drug-image { 
  margin-bottom: 10px; 
}
.drug-action { 
  border-left: none; 
  padding-left: 0; 
  margin-top: 10px; 
  width: 100%; 
}
.btn-details { 
  display: block; 
  width: 100%; 
  text-align: center; 
  background: #f0f0f0; 
  padding: 8px; 
  border-radius: 4px; 
}