/* ==================== PROFILE PICTURE ==================== */

#profile-picture {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

/* Avatar image */
#profile-picture img.avatar {
  object-fit: cover;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  /* ✅ Primary color border */
  border: 4px solid hsl(var(--primary) / 0.2);
  box-shadow: 0 10px 25px -5px hsl(var(--primary) / 0.2),
              0 8px 10px -6px hsl(var(--primary) / 0.1);
  transition: all 0.3s ease-in-out;
}

/* Hover effect */
#profile-picture img.avatar:hover {
  border-color: hsl(var(--primary) / 0.4);
  box-shadow: 0 20px 25px -5px hsl(var(--primary) / 0.3),
              0 10px 10px -5px hsl(var(--primary) / 0.2);
  transform: scale(1.05);
}

/* ==================== UPLOAD SECTION ==================== */

#profile-upload-holder {
  padding-top: 1rem;
  text-align: center;
}

/* Hide default file input */
#profile-upload-holder input[type="file"] {
  display: none;
}

/* Upload label/button */
#profile-upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  border: 2px solid hsl(var(--primary) / 0.2);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  user-select: none;
}

/* Hover state */
#profile-upload-label:hover {
  background: hsl(var(--primary) / 0.15);
  border-color: hsl(var(--primary) / 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px hsl(var(--primary) / 0.1),
              0 2px 4px -2px hsl(var(--primary) / 0.05);
}

/* Active/Loading state */
#profile-upload-label.is-active {
  background: hsl(var(--primary) / 0.15);
  border-color: hsl(var(--primary) / 0.3);
  pointer-events: none;
}

/* Success state */
#profile-upload-label.pg-text-success {
  color: hsl(142 76% 36%); /* Green */
  background: hsl(142 76% 36% / 0.1);
  border-color: hsl(142 76% 36% / 0.2);
}

/* Error state */
#profile-upload-label.pg-text-danger {
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive) / 0.2);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 640px) {
  #profile-picture img.avatar {
    width: 96px;
    height: 96px;
    border-width: 3px;
  }
  
  #profile-upload-label {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }
}

/* ==================== DARK MODE ==================== */

@media (prefers-color-scheme: dark) {
  #profile-picture img.avatar {
    border-color: hsl(var(--primary) / 0.3);
    box-shadow: 0 10px 25px -5px hsl(var(--primary) / 0.3),
                0 8px 10px -6px hsl(var(--primary) / 0.15);
  }
  
  #profile-picture img.avatar:hover {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 20px 25px -5px hsl(var(--primary) / 0.4),
                0 10px 10px -5px hsl(var(--primary) / 0.25);
  }
  
  #profile-upload-label {
    background: hsl(var(--primary) / 0.15);
    border-color: hsl(var(--primary) / 0.3);
  }
  
  #profile-upload-label:hover {
    background: hsl(var(--primary) / 0.2);
    border-color: hsl(var(--primary) / 0.4);
  }
}

/* ==================== LOADING SPINNER ==================== */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ==================== SMOOTH TRANSITIONS ==================== */

.avatar {
  transition: opacity 0.3s ease-in-out,
              transform 0.3s ease-in-out,
              border-color 0.3s ease-in-out,
              box-shadow 0.3s ease-in-out;
}

/* ==================== UPLOAD ICON STYLES ==================== */

#profile-upload-label svg {
  flex-shrink: 0;
  transition: transform 0.2s ease-in-out;
}

#profile-upload-label:hover svg {
  transform: scale(1.1);
}

/* ==================== FOCUS STATES (ACCESSIBILITY) ==================== */

#profile-upload:focus + #profile-upload-label {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}
.progress-bar {
  background-color: var(--primary);
  width: 2px;
}

#progress-bar-message {
  color: var(--gray);
}

.add-loading-dots:after {
  content: ' .';
  animation: dots 1s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% {
    color: rgba(0, 0, 0, 0);
    text-shadow: .25em 0 0 rgba(0, 0, 0, 0), .5em 0 0 rgba(0, 0, 0, 0);
  }

  40% {
    color: black;
    text-shadow: .25em 0 0 rgba(0, 0, 0, 0), .5em 0 0 rgba(0, 0, 0, 0);
  }

  60% {
    text-shadow: .25em 0 0 black, .5em 0 0 rgba(0, 0, 0, 0);
  }

  80%, 100% {
    text-shadow: .25em 0 0 black, .5em 0 0 black;
  }
}

/* alpine.js cloak support */
[x-cloak] {
  display: none !important;
}

/* ensure htmx links use pointers */
a[hx-get] {
  cursor: pointer;
}

.h-100 {
  height: 100%;
}

.muted-link {
  color: hsl(0, 0%, 71%);
}

.muted-link:hover {
  color: hsl(0, 0%, 48%);
  text-decoration: underline;
}

/* this is the default class assigned to errors by django forms */
.errorlist {
  color: var(--danger);
}

img.socialicon {
  padding-right: 0.5em;
  max-width: 24px;
  max-height: 24px;
}

/* css loader https://loading.io/css/ */
.lds-ripple {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.lds-ripple div {
  position: absolute;
  border: 4px solid var(--primary);
  opacity: 1;
  border-radius: 50%;
  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.lds-ripple div:nth-child(2) {
  animation-delay: -0.5s;
}

@keyframes lds-ripple {
  0% {
    top: 36px;
    left: 36px;
    width: 0;
    height: 0;
    opacity: 1;
  }

  100% {
    top: 0px;
    left: 0px;
    width: 72px;
    height: 72px;
    opacity: 0;
  }
}

@charset "utf-8";

@charset "utf-8";

