/* Persistent Notification Styles - Mobile-first responsive design */

.persistent-notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
  width: calc(100% - 40px);
}

.persistent-notification {
  position: relative;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.persistent-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-content {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.clickable-content {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.clickable-content:hover {
  opacity: 0.9;
}

.notification-icon {
  font-size: 28px;
  width: 35px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  line-height: 1;
}

.notification-message {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 5px;
  word-wrap: break-word;
}

.notification-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.notification-progress-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

/* OLD PROGRESS BAR - KEEPING FOR COMPATIBILITY BUT NOT USED */
/*
.notification-progress-container {
    margin-top: 15px;
}

.notification-progress-container:empty {
    display: none;
    margin: 0;
}

.notification-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    animation: none !important;
    transform: none !important;
}

.notification-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #357abd);
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
    transform-origin: left center;
    display: block !important;
    opacity: 1 !important;
}
*/

/* SIMPLE PROGRESS BAR - NO CONFLICTS */
.simple-progress-wrapper {
  margin-top: 15px;
}

.simple-progress-wrapper:empty {
  display: none;
}

.simple-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  /* NO ANIMATIONS */
}

.simple-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #357abd);
  border-radius: 3px;
  transition: width 0.5s ease;
  /* NO ANIMATIONS, JUST WIDTH TRANSITION */
}

/* Shimmer animation removed to prevent interference with progress bar */

/* State-specific styles */
.persistent-notification.uploading .notification-icon {
  color: #4a90e2;
  animation: pulse 2s infinite;
}

.persistent-notification.success {
  border-color: rgba(40, 167, 69, 0.3);
  background: rgba(20, 30, 20, 0.95);
}

/* Ensure success notifications are clickable */
.persistent-notification.success.dismissible {
  cursor: pointer !important;
}

.persistent-notification.success.dismissible:hover {
  opacity: 0.9;
}

.persistent-notification.success .notification-icon {
  color: #28a745;
}

.persistent-notification.error {
  border-color: rgba(220, 53, 69, 0.3);
  background: rgba(30, 20, 20, 0.95);
}

.persistent-notification.error .notification-icon {
  color: #dc3545;
}

/* Actions */
.notification-actions {
  margin-top: 12px;
}

.retry-button {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.retry-button:hover:not(:disabled) {
  background: rgba(220, 53, 69, 0.3);
  border-color: rgba(220, 53, 69, 0.6);
  transform: translateY(-1px);
}

.retry-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.retry-button i {
  font-size: 12px;
}

.notification-error-detail {
  margin-top: 5px;
  font-size: 12px;
  opacity: 0.8;
}

.persistent-notification.dismissible {
  cursor: pointer;
}

/* Make success notifications more obviously clickable */
.persistent-notification.success.dismissible {
  transition: all 0.2s ease;
}

.persistent-notification.success.dismissible:hover {
  opacity: 0.85;
  transform: translateX(-5px);
  box-shadow: 0 8px 32px rgba(76, 175, 80, 0.6);
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .persistent-notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .persistent-notification {
    padding: 16px;
  }

  .notification-icon {
    font-size: 20px;
    width: 24px;
  }

  .notification-title {
    font-size: 15px;
  }

  .notification-subtitle {
    font-size: 13px;
  }

  .notification-progress-text {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .persistent-notification-container {
    top: 5px;
    right: 5px;
    left: 5px;
  }

  .persistent-notification {
    padding: 14px;
    border-radius: 10px;
  }

  .notification-content {
    gap: 12px;
  }

  .notification-progress-container {
    margin-top: 12px;
  }

  .notification-progress-bar {
    height: 5px;
  }

  .retry-button {
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .persistent-notification {
    padding: 12px;
  }

  .notification-title {
    font-size: 14px;
  }

  .notification-subtitle,
  .notification-progress-text {
    font-size: 12px;
  }

  .notification-actions {
    margin-top: 10px;
  }
}

/* Additional utility classes for dynamic styles */
.notification-clickable {
  cursor: pointer;
  user-select: none;
}

.notification-child-unclickable {
  pointer-events: none;
  cursor: pointer;
}

/* Progress bar width using CSS custom properties */
.simple-progress-fill {
  width: var(--progress-width, 0%);
}

/* Dismiss button styling */
.dismiss-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.dismiss-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.dismiss-button i {
  font-size: 14px;
}

/* Progress bar width data attributes */
.simple-progress-fill[data-progress='0'] {
  width: 0%;
}
.simple-progress-fill[data-progress='5'] {
  width: 5%;
}
.simple-progress-fill[data-progress='10'] {
  width: 10%;
}
.simple-progress-fill[data-progress='15'] {
  width: 15%;
}
.simple-progress-fill[data-progress='20'] {
  width: 20%;
}
.simple-progress-fill[data-progress='25'] {
  width: 25%;
}
.simple-progress-fill[data-progress='30'] {
  width: 30%;
}
.simple-progress-fill[data-progress='35'] {
  width: 35%;
}
.simple-progress-fill[data-progress='40'] {
  width: 40%;
}
.simple-progress-fill[data-progress='45'] {
  width: 45%;
}
.simple-progress-fill[data-progress='50'] {
  width: 50%;
}
.simple-progress-fill[data-progress='55'] {
  width: 55%;
}
.simple-progress-fill[data-progress='60'] {
  width: 60%;
}
.simple-progress-fill[data-progress='65'] {
  width: 65%;
}
.simple-progress-fill[data-progress='70'] {
  width: 70%;
}
.simple-progress-fill[data-progress='75'] {
  width: 75%;
}
.simple-progress-fill[data-progress='80'] {
  width: 80%;
}
.simple-progress-fill[data-progress='85'] {
  width: 85%;
}
.simple-progress-fill[data-progress='90'] {
  width: 90%;
}
.simple-progress-fill[data-progress='95'] {
  width: 95%;
}
.simple-progress-fill[data-progress='100'] {
  width: 100%;
}

/* Dark mode support (already dark by default) */
@media (prefers-color-scheme: light) {
  .persistent-notification {
    background: rgba(255, 255, 255, 0.95);
    color: #212529;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }

  .persistent-notification.success {
    background: rgba(240, 255, 240, 0.95);
    border-color: rgba(40, 167, 69, 0.2);
  }

  .persistent-notification.error {
    background: rgba(255, 240, 240, 0.95);
    border-color: rgba(220, 53, 69, 0.2);
  }

  .notification-title {
    color: #212529;
  }

  .notification-subtitle,
  .notification-progress-text {
    color: rgba(0, 0, 0, 0.7);
  }

  .notification-progress-bar {
    background: rgba(0, 0, 0, 0.1);
  }

  .retry-button {
    color: #212529;
  }
}
