.auth-wrapper {
  height: calc(100vh - 60px);
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg);
  box-sizing: border-box;
}

.auth-container {
  width: 100%;
  background: var(--bg);
  max-width: 480px;
  padding: 10px 20px 5px 20px;
  margin: 0 15px;
  border-radius: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}

.auth-container h2 {
  text-align: center;
  font-size: 30px;
  margin: 10px 0 16px 0;
  color: var(--text);
}

.auth-container form p {
  color: var(--text-muted);
}

.auth-container input,
.auth-container select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.auth-container input:focus,
.auth-container select:focus {
  border: 1px solid var(--border);
  color: var(--text);
}

.auth-container select[id*="day"],
.auth-container select[id*="month"],
.auth-container select[id*="year"] {
  display: inline-block;
  width: 32%;
  margin-right: 2%;
  margin-bottom: 10px;

}

.auth-container select[id*="year"] {
  margin-right: 0;
}

.auth-btn {
  background-color: var(--bg);
  color: black;
  font-weight: bold;
  width: 100%;
  padding: 7px;
  border: 1px solid black;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.3s;

}

.auth-btn:hover {
  background-color: black;
  color: white;
}

.register-note {
  margin: 10px 0 5px 0;
  font-size: 14px;
  color: var(--text);
}

.register-note a {
  font-weight: bold;
  color: var(--action);
  text-decoration: none;
}

.register-note a:hover {
  color: var(--hover);
}

.forgot-password {
  margin: 7px 0;
  font-size: 14px;
  text-align: end;
}
.forgot-password a:hover {
  color: var(--hover);
}

.auth-description{
  margin-bottom: 10px;
}

/* ----------------------------------------- Profile Page ---------------------------------- */
.profile-container {
    width: 100%;
    padding: 0 15px;
    margin-top: 30px;
}

.profile-logout-container {
    width: 100%;
    padding: 0 15px;
    margin-top: 55px;
}

.profile-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-info .heading {
    height: 200px;
    width: 100%;
    border: 1px solid var(--border);
    background-color: #d6d6d6;
    border-radius: 8px;
    margin-bottom: -80px;
    position: relative;
    z-index: 1;
}

/* The white card */
.profile-info .profile-details {
    width: 90%;
    background: white;
    border: 1px solid black;
    border-radius: 8px;
    padding: 80px 20px 20px; /* Room for avatar */
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 10px;
}

/* Avatar box */
.profile-info .profile-image {
    height: 150px;
    width: 150px;
    position: absolute;
    top: -75px;           /* Avatar sticks out of the card */
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid black;
    border-radius: 50%;
    z-index: 3;
}

/* Avatar content */
.profile-info .profile-image img,
.profile-info .profile-image .placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    cursor: pointer;
}

.profile-info .profile-image .placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: 700;
    cursor: pointer;
}

/* Bio text */
.profile-info .profile-text {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text);
}

/* Default: show full text, hide toggle links */
.profile-info .profile-text .bio-content,
.profile-info .profile-text .toggle-text {
    display: none;
}

.profile-info .profile-text .full-bio {
    display: block;
}

.profile-info .profile-text .toggle-collapse {
    display: none;
}

/* Mobile: text limiting with toggle */
@media (max-width: 880px) {
  /* Default state on mobile: show truncated text + "Read more" */
  .profile-info .profile-text .bio-content {
    display: inline;
  }

  .profile-info .profile-text .toggle-text {
    display: inline;
  }

  .profile-info .profile-text .full-bio,
  .profile-info .profile-text .toggle-collapse {
    display: none;
  }

  .profile-info .profile-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
  }

  /* Expanded state */
  .profile-info .profile-text.expanded .bio-content {
    display: none;
  }

  .profile-info .profile-text.expanded .toggle-text:not(.toggle-collapse) {
    display: none;
  }

  .profile-info .profile-text.expanded .full-bio {
    display: block;
  }

  .profile-info .profile-text.expanded .toggle-collapse {
    display: inline;
  }
}


/* Content filters */
.content-filters{
    padding: 10px 2px 0 0;
    margin: 0 20px 10px 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.content-filters li a{
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.content-filters li .active{
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

/* -------------------------------- Settings --------------------------- */
.settings-content {
  width: 100%;
  max-width: 800px;     /* limit the maximum width */
  margin: 30px auto 10px; /* center horizontally */
  gap: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 12px;     /* small side padding for small screens */
  box-sizing: border-box;
}

.settings-content p {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--text);
}

.form-field label{
  color: var(--text);
}

.date-select-group {
  display: flex;
  gap: 10px;
}

.date-select-group select {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  box-sizing: border-box;
}

.settings-content input,
.settings-content select,
.settings-content textarea {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  box-sizing: border-box;
  color: var(--text);
  margin-bottom: 10px;
}

/* Avatar preview in settings form */
.avatar-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px auto 30px;
    position: relative;
}

.avatar-preview {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    background-color: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .15s ease-in-out;
    position: relative;
}

.avatar-preview:hover {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview .placeholder {
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--text);
    text-transform: uppercase;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg);
    line-height: 1;
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: rgba(0,0,0,0.45);
    color: white;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}

.avatar-preview:hover .avatar-overlay {
    opacity: 1;
}

/* Hide real input */
.settings-content input[type="file"][name$="avatar"],
.settings-content input[type="file"]#id_avatar {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

#id_avatar ~ *,
#id_avatar + *,
#id_avatar + br {
    display: none !important;
}

/* Hide items BEFORE the input (Django sometimes outputs them earlier) */
.avatar-field > span:not(.placeholder),
.avatar-field a:not(.avatar-preview),
.avatar-field br,
.avatar-field input[type="checkbox"],
.avatar-field label[for$="clear_id"] {
    display: none !important;
}

/* Also hide anything between preview and file input */
.avatar-preview ~ *:not(#id_avatar) {
    display: none !important;
}


.settings-content input:focus,
.settings-content select:focus,
.settings-content textarea:focus {
  border: 1px solid var(--hover);
  color: var(--action);
}

.settings-content button {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 20px;
  color: black;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
}

.delete-btn{
  background-color: var(--bg);
  border: 1px solid var(--border);
}

.content-container .form-card .cancel-btn {
  background-color: var(--error);
  color: black;
  border: 1px solid var(--error);
  border-radius: 3px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
}

.settings-routs{
  list-style-type:none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-rout{
  color: var(--text);
  text-decoration-color: var(--hover);
}

.settings-routs .settings-rout .rout-list.active{
  color: var(--hover);
}

.settings-rout a:hover{
  color: var(--text-muted);
}

.header-title{
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  padding: 5px;
  font-size: 24px;
  text-align: center;
  margin-bottom: 10px;
}

.default-text{
  color: var(--text-muted);
  text-align: center;
  margin-top: 40px;
}

/* -------------------------------- Online / Offline ------------------------ */
.online-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: var(--success);
  border-radius: 50%;
  margin-left: 0;
  margin-bottom: 15px;
}

.offline-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: var(--error);
  border-radius: 50%;
  margin-left: 0;
  margin-bottom: 15px;
}

/* ---------------------------- Library ---------------------------- */
.content-container .heading{
  font-size: 24px;
  margin: -5px 0 10px 0;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  width: fit-content;
}

@media (max-width: 880px) {
  .profile-info .profile-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
  }

  /* Expanded state */
  .profile-info .profile-text.expanded .bio-content {
    display: none;
  }

  .profile-info .profile-text.expanded .toggle-text:not(.toggle-collapse) {
    display: none;
  }

  .profile-info .profile-text.expanded .full-bio {
    display: block;
  }

  .profile-info .profile-text.expanded .toggle-collapse {
    display: inline;
  }

  .profile-info .profile-text .toggle-text {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    margin-left: 5px;
  }

  .profile-info .profile-text .toggle-text:hover {
    color: var(--text);
    text-decoration: underline;
  }

  .profile-info .heading {
    height: 100px;
    width: 100%;
    border: 1px solid var(--border);
    background-color: #d6d6d6;
    border-radius: 8px;
    margin-bottom: -80px;
    position: relative;
    z-index: 1;
  }

  /* The white card */
  .profile-info .profile-details {
    top: 20px;
    width: 90%;
    background: white;
    border: 1px solid black;
    border-radius: 8px;
    padding: 55px 20px 20px; /* Room for avatar */
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 10px;
  }

  /* Avatar box */
  .profile-info .profile-image {
      height: 75px;
      width: 75px;
      position: absolute;
      top: -25px;           /* Avatar sticks out of the card */
      left: 50%;
      transform: translateX(-50%);
      background: white;
      border: 1px solid var(--border);
      border-radius: 50%;
      z-index: 3;
  }

  /* Avatar content */
  .profile-info .profile-image img,
  .profile-info .profile-image .placeholder {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: inherit;
      display: block;
      cursor: pointer;
  }

  .profile-info .profile-image .placeholder {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 2.5rem;
      font-weight: 700;
      cursor: pointer;
  }
  
}
