/*css colors*/
/*pink #db1f8a*/
/*black #000000*/
/*white #ffffff*/

/*wildcard selectors*/
* h1,
h2,
h3,
p {
  color: black;
  margin-left: 15px;
}

body {
  background-color: #db1f8a;
  margin-left: 3px;
  padding-bottom: 120px;
}

#user-profile h1,
#user-profile h2,
#user-profile h3,
#user-profile p {
  margin-left: 0;
  color: black;
}

/* HEADER */

#site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 6px;
  padding: 8px 0 0;
  position: relative;
  margin-bottom: 10px;
}

.tittle{
  grid-column: 1 / -1;
  width: 100%;
  display: block;
  text-align: center;
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  line-height: 1.1;
}

h1 {
  text-align: center;
  font-size: 180%;
}

#nav-btn {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  height: 30px;
  width: fit-content;
  font-size: 100%;
  font-weight: bold;
  border: 2px solid black;
  border-radius: 5px;
  margin-left: 10px;
}

#nav-btn:hover {
  color: white;
  background-color: black;
  border: solid white 2px;
}

#moogle-logo {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  align-self: start;
  margin-top: -22px;
}

#moogle-logo img {
  height: 120px;
  width: auto;
  display: block;
  margin: 0;
}

#user-profile {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgb(19, 209, 184);
  padding: 3px 8px; 
  border: 2px solid black;
  border-radius: 10px;
  z-index: 1000;
  gap: 8px;
  max-width: 140px;
  min-width: 100px;
  box-sizing: border-box;
  margin-right: 10px;
}

#nav-list {
  list-style-type: none;
  position: absolute;
  left: -200px;
  top: 80px;
  background-color: white;
  border: solid 2px black;
  border-radius: 8px;
  padding-left: 5px;
  padding-right: 5px;
  z-index: 9999;
}

#nav-list.show {
  left: 10px;
}

#nav-list li {
  text-align: left;
  padding: 5px 0;
}

#nav-list a {
  text-decoration: none;
  color: black; 
}

#nav-btn,
#logo,
#user-profile {
  align-self: start;
}

/* FOOTER */

#footer {
  position: fixed;
  bottom: 0px;
  width: 97%;
  height: 100px;
  background-color: aliceblue;
  border: solid 2px black;
  border-radius: 8px;
}

#footer-list {
  list-style-type: none;
  text-align: center;
  padding-left: 0px;
  padding-top: 15px;
}

#footer-list a {
  font-size: 190%;
  display: inline-block;
  color: black;
}

.footer-icons {
  display: inline-block;
  padding-left: 10px;
  padding-right: 10px;
}


.footer-img {
  height: 32px;
  width: auto;
  padding: 3px;
  display: inline-block;
  object-fit: contain;
}

/* PROFILE CARD */

.edit-profile-link {
  font-size: 0.7rem;
  color: black !important;
  background-color: white;
  border: solid black 2px;
  border-radius: 8px;
  padding: 3px;
  text-decoration: none;
  display: block;
  margin-top: 4px;
  text-align: center;
  font-weight: bold;
}
.edit-profile-link:hover {
  color: white !important;
  background-color: black;
  border: solid white 2px;
  border-radius: 8px;
  padding: 3px;
  text-decoration: none;
}

.profile-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
  border: 2px solid white;
}

.user-text { font-size: 0.85rem; color: black; text-align: left; line-height: 1.2; }
.user-text p { margin: 0; color: black; }

.moogle-count img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

.edit-profile-link { font-size: 0.7rem; color: black; text-decoration: none; display: inline-block; margin-top: 2px; }
.edit-profile-link:hover { text-decoration: none; }

#profilePicModal {
  display: none;
  position: fixed;
  top: 20%; 
  left: 50%; 
  transform: translateX(-50%);
  background-color: rgb(19, 209, 184);
  padding: 20px;
  border: 1px solid black;
  border-radius: 8px;
  z-index: 9999;
}

  /* Upload error modal */
  .upmodal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
  }
  .upmodal {
    background: #fff;
    border: 2px solid #e53935;
    border-radius: 10px;
    width: min(520px, 92vw);
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  }
  .upmodal h3 {
    margin: 0 0 8px;
    color: #b71c1c;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  .upmodal p {
    margin: 0 0 14px;
    color: #444;
    line-height: 1.45;
  }
  .upmodal .upmodal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
  }
  .upmodal button {
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
  }
  .upmodal .btn-close {
    background: #efefef;
    color: #333;
  }
  .upmodal .btn-close:hover {
    background: #e4e4e4;
  }
  .upmodal .btn-ok {
    background: #e53935;
    color: #fff;
  }
  .upmodal .btn-ok:hover {
    background: #cf2f2b;
  }

  .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* MEDIA QUERIES */

/* QURRIES MIN SCREEN 768 */
@media screen and (min-width: 768px) {
  .tittle { font-size: 46px; margin-left: -20px; }

  #logo img {
    height: 100px;
    width: auto;
    position: absolute;
    left: 64%;
    top: -10px;
    margin: 0;
    display: block;
  }

  #nav-btn {
    position: absolute;
    top: -45px;
    left: 10px;
    margin: 0;
  }

  #user-profile {
    position: absolute;
    top: -50px;
    right: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 6px 10px;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    min-height: 86px;

    margin: 0;
    box-sizing: border-box;
  }

  #user-profile .user-info {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
  }

  #user-profile .profile-pic {
    width: 42px;
    height: 42px;
    border: 2px solid white;
  }

  #user-profile .user-text {
    margin: 0;
    color: black;
    font-size: 0.85rem;
    line-height: 1.15;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  #user-profile .moogle-count { align-self: flex-start; }

  #user-profile .edit-profile-link {
    align-self: flex-start;
    display: inline-flex;
    margin: 2px 0 0;
    padding: 4px 10px;
    font-size: 0.82rem;

    color: black !important;
    background: white;
    border: 2px solid #000;
    border-radius: 8px;
  }

  .user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  #currentProfilePic { margin-top: 0; }
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
  #site-header { position: relative; }

  #logo {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-210px);
    z-index: 2;
  }

  #logo img {
    height: 100px;
    width: auto;
    display: block;
  }
}