@import url("https://fonts.googleapis.com/css2?family=Bubblegum+Sans&display=swap");
:root {
  --primary-color: #D92828;
  --secondary-color: #4381A8;
  --accent-color: #F5F387;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --bg-light: #ffffff;
  --bg-dark: #f5f5f5;
  --text-dark: #333333;
  --text-light: #ffffff;
  --border-radius: 10px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Bubblegum Sans", sans-serif;
}

html,
body {
  height: 100%;
}

button {
  cursor: pointer;
  transition: all 0.3s ease;
}

header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0px;
  margin-top: 1rem;
  margin-left: 1rem;
  margin-right: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 252, 232, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 24px rgba(67, 129, 168, 0.12);
  backdrop-filter: blur(14px);
  border-radius: 24px;
  z-index: 1000;
}

#header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  cursor: pointer;
  background: transparent;
  border: none;
  margin-left: 8px;
  gap: 1rem;
}

#header-left > img {
  height: 50px;
  width: auto;
}

#header-left > h4 {
  font-size: 2em;
  color: #4381a8;
}

#header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

#header-right > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  min-height: 44px;
  border: 1px solid rgba(67, 129, 168, 0.2);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.56);
  color: #4381a8;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.3s ease;
}

#header-right > button:hover {
  background-color: rgba(67, 129, 168, 0.12);
  border-color: rgba(67, 129, 168, 0.32);
}

#profil {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}
#profil .circle {
  margin: 0;
}

.circle:hover {
  background-color: rgba(67, 129, 168, 0.8);
  transition: all 0.3s ease;
}
.popup-menu-btn:hover {
  background-color: rgba(67, 129, 168, 0.1);
  transition: all 0.3s ease;
}
.popup-menu-btn{
  outline: none;
}
.circle {
  border-radius: 100%;
  background-color: #4381a8;
  width: clamp(44px, 4vw, 56px);
  height: clamp(44px, 4vw, 56px);
  font-size: clamp(1.1rem, 2vw, 1.65rem);
  color: #ffffff;
  display: flex;
  font-family: "Bubblegum Sans" , sans-serif;
  align-items: center;
  justify-content: center;
}

.popup-sign {
  visibility: hidden;
  position: absolute;
  z-index: 1;
  right: 0;
  top: calc(100% + 0.6rem);
  width: min(220px, calc(100vw - 2rem));
  min-height: 100px;
  /* display */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /*sytle*/
  background-color: white;
  border: none;
  border-radius: 5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
}


.popup-sign button {
  display: flex;
  border: none;
  justify-content: start;
  gap: 1rem;
  padding-left:1rem ;
  align-items: center;
  background-color: transparent;
  min-height: 44px;
  height: 50%;
  cursor: pointer;
  font-size: 20px;
}

/* --------------------------------------Body-------------------------------------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f387;
  background-image:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.55) 0 34px, rgba(255, 255, 255, 0.18) 35px 68px, transparent 69px),
    radial-gradient(circle at 82% 14%, rgba(67, 129, 168, 0.18) 0 40px, rgba(67, 129, 168, 0.08) 41px 78px, transparent 79px),
    radial-gradient(circle at 88% 76%, rgba(217, 40, 40, 0.14) 0 52px, rgba(217, 40, 40, 0.06) 53px 96px, transparent 97px),
    radial-gradient(circle at 18% 82%, rgba(67, 129, 168, 0.12) 0 30px, rgba(67, 129, 168, 0.05) 31px 60px, transparent 61px),
    radial-gradient(circle at 58% 48%, rgba(255, 255, 255, 0.3) 0 18px, rgba(255, 255, 255, 0.08) 19px 34px, transparent 35px),
    radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.24) 0 14px, rgba(255, 255, 255, 0.06) 15px 28px, transparent 29px),
    linear-gradient(180deg, #fffce7 0%, #f8f0aa 44%, #ecde87 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

section {
  flex-grow: 1;
  display: flex;
  padding: 20px;
}

img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}



.button {
  position: relative;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  /* Safari */
  -webkit-transition-duration: 0.4s;
  -webkit-user-select: none;
  transition-duration: 0.4s;
  user-select: none;
}

.button:hover {
  transition-duration: 0.1s;
  filter: brightness(90%);
}

.button:after {
  content: "";
  display: block;
  position: absolute;
  border-radius: 4em;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: all 0.5s;
  box-shadow: 0 0 10px 20px rgb(121, 121, 121);
}

.button:active:after {
  box-shadow: 0 0 0 0 rgb(118, 118, 118);
  position: absolute;
  border-radius: 1em;
  left: 0;
  top: 0;
  opacity: 1;
  transition: 0s;
}

.button:active {
  top: 1px;
}

/* --------------------------------------Body-------------------------------------- */
footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: auto;
  min-height: 60px;
  padding: 10px 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(23, 98, 167, 0.73);
}

.FooterLeft {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  margin-left: 5%;
  gap: 20px;
}

.FooterLeft>button {
  margin-left: 2%;
}

.FooterRight {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  margin-right: 5%;
  gap: 20px;
}

footer > div > button {
  background-color: transparent;
   
  color: #ffffff;
  font-weight: 400;
  font-size: clamp(18px, 3vw, 30px);
  border: none;
  padding: 5px 10px;
  margin: 0;
  transition: all 0.3s ease;
}

footer > div > button:hover {
  text-decoration: underline;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

/* disable clicks */
.overlay {
  display: none;
  position: absolute;
  top: 0%;
  left: 0%;
  width: 100%;
  height: 100%;
  background-color: black;
  z-index: 1001;
  -moz-opacity: 0.8;
  opacity: .80;
  filter: alpha(opacity=80);
}

/* logout container */
.logout-popup {
  visibility: hidden;
  /* aligning center  */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* styling */
  font-size: 30px;
  background-color: #fffefe;
  border: 2px solid #4381a8;
  text-align: center;
  padding: 20px;
  width: min(35rem, calc(100vw - 2rem));
  z-index: 99999;
}

#logout-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-evenly;
  margin: 20px 5px;
}

#logout-buttons>button {
  font-style: normal;
  font-weight: 400;
  font-size: 16pt;
  margin-top: 2rem;
  width: 180px;
  padding: 10px;
  border: none;
  border-radius: 5px;
}
#logout-yes{
  background: #d92828;
  color: #ffffff;

}
#logout-no{
  background: #959595;
  color: #f9f9f9;
}

/* edit profil  */
#edit-profile-popup {
  /* hide it until it is clicked */
  visibility: hidden;
  /* positioning */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* styling  */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  border: 2px solid #4381a8;
  border-radius: 5px;
  background-color: #fff;
  width: min(35rem, calc(100vw - 2rem));
  z-index: 999999;
}

#edit-profile-popup h3 {
  cursor: pointer;
  padding: 5px 25px;
  color: rgb(21, 21, 21);
  transition: ease .2s;
}

#edit-profile-popup h3:hover {
  border-radius: 15px;
  background-color: #efefef;
  transition: ease .2s;
}
#profile-edit-form{
  width: 100%;
  padding: 2rem;
}
#edit-form-inputs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-family: "Bubblegum Sans", sans-serif;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 0rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(67, 129, 168, 0.2);
  outline: none;
}
.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 2rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 300px;
  max-width: 90%;
  text-align: center;
}
input[type="text"], input[type="email"], input[type="password"] {
  background: transparent;
  font-family: "Bubblegum Sans", sans-serif;
  font-size: 1rem;
  color: var(--primary-color);
  text-align: center;
}

.dialog.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.dialog h2 {
  font-family: "Bubblegum Sans", sans-serif;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

#logout-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition: var(--transition);
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}


.helper-text {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-top: 0.25rem;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.profile-image {
  width: 60px;
  height: 60px;
  line-height: 60px;
  font-size: 24px;
  margin: 0 auto 1.5rem;
}


#edit-form-inputs>input {
  border: 1px solid #4381a8;
  border-radius: 5px;
  margin-top: 15px;
  padding: 5px;
  width: 80%;
  height: 35px;
  font-size: 24px;
}

#submit-edit {
  border: 2px solid #4381a8;
  background-color: #fff;
  color: #d92828;
  border-radius: 5px;
  outline: none;
  padding: 10px 25px;
  font-size: 22px;
  margin-top: 15px;
}
#cancel-edit {
  border: 2px solid #4381a8;
  background-color: #fff;
  color: #d92828;
  border-radius: 5px;
  outline: none;
  padding: 10px 25px;
  font-size: 22px;
  margin-top: 15px;
}
#edit-form-inputs>input:focus {
  outline: none;
  border: 2px solid #4381a8;
}

.primary-button, .secondary-button, .danger-button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-family: "Bubblegum Sans", sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}


/* footer */
footer>div>button {
  background-color: transparent;
   
  color: #ffffff;
  font-weight: 400;
  font-size: clamp(18px, 3vw, 30px);
  border: none;
  padding: 5px 10px;
  margin: 0;
  transition: all 0.3s ease;
}

footer>div>button:hover {
  text-decoration: underline;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

/* Responsive adjustments for base elements */
@media (max-width: 768px) {

  
  header {
    padding: 8px 15px;
    margin: 8px 10px;
  }
  
  #header-left {
    gap: 8px;
  }
  
  #header-left > h4 {
    font-size: 22px;
  }
  
  #header-left > img {
    height: 35px;
    width: auto;
  }
  
  #header-right {
    gap: 10px;
  }
  
  #header-right > button {
    padding: 8px 16px;
    font-size: 16pt;
  }
  #edit-profile-popup {
    width: 75%;
    padding: 15px;

  }
  #edit-form-inputs {
    align-items: start;
  }
  .primary-button {
    padding: 10px 18px;
    font-size: 16px;
  }
  
  /* Make dialogs more mobile-friendly */
  .dialog {
    width: 90%;
    max-width: 400px;
    padding: 15px;
  }
  
  .profile-image {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    gap: 10px;
    padding: 8px;
  }
  
  #header-right {
    width: 100%;
    justify-content: space-around;
  }
  
  #header-right > button {
    font-size: 16pt;
    padding: 6px 12px;
  }
  
  .popup-sign {
    right: 0;
    width: 180px;
  }
  
  .circle {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  #profil {
    margin-left: 0;
  }
  
  .dialog {
    padding: 12px;
  }
  
  .form-group input {
    font-size: 14pt;
    padding: 8px 12px;
  }
  
  .dialog-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .dialog-actions button {
    width: 100%;
  }
}

/* Improved touch targets for mobile */
@media (pointer: coarse) {
  .circle, button, input[type="submit"], input[type="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  .popup-menu-btn {
    padding: 10px 15px;
  }
}

/* Support for very small devices */
@media (max-width: 360px) {
  #header-left > h4 {
    font-size: 20px;
  }
  
  #header-left > img {
    height: 30px;
  }
  
  #header-right > button {
    font-size: 16pt;
    padding: 5px 10px;
  }
  
  .circle {
    width: 36px;
    height: 36px;
  }
}