/* Messages Styles */
.messages-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 10000;
  max-width: 420px;
  width: auto;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
  border: none;
  position: relative;
  pointer-events: auto;
  transform: translateX(0);
  opacity: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  background: var(--white);
  min-width: 320px;
  max-width: 420px;
  overflow: hidden;
}

.message-closing {
  animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

@keyframes progressBar {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

.message-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.message-text {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  color: inherit;
  margin: 0;
}

.message-close {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  opacity: 0.7;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  position: relative;
  z-index: 2;
}

.message-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.15) rotate(90deg);
}

.message-close:active {
  transform: scale(0.9) rotate(90deg);
}

.message-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 12px 12px;
  z-index: 1;
}

/* Message Types */
.message-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
  color: #065f46;
  border-left: 4px solid #10b981;
}

.message-success .message-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.message-success .message-progress {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.message-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%);
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.message-error .message-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  animation: pulse-error 2s infinite;
}

.message-error .message-progress {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

@keyframes pulse-error {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4), 0 0 0 6px rgba(239, 68, 68, 0.1);
  }
}

.message-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.message-warning .message-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  animation: pulse-warning 3s infinite;
}

.message-warning .message-progress {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

@keyframes pulse-warning {
  0% {
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3), 0 0 0 6px rgba(245, 158, 11, 0.1);
  }
  100% {
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
  }
}

.message-info {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 50%, #a5f3fc 100%);
  color: #155e75;
  border-left: 4px solid #06b6d4;
}

.message-info .message-icon {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.message-info .message-progress {
  background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
  .messages-container {
    top: 80px;
    right: 10px;
    left: auto;
    max-width: calc(100% - 20px);
  }
  
  .message {
    padding: 14px 16px;
    min-width: 280px;
    max-width: calc(100vw - 20px);
  }
  
  .message-text {
    font-size: 13px;
  }
  
  .message-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .messages-container {
    top: 70px;
    right: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
  }
  
  .message {
    padding: 12px 14px;
    gap: 12px;
    min-width: auto;
    max-width: 100%;
  }
  
  .message-icon {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
  
  .message-close {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  
  .message-text {
    font-size: 12px;
  }
}
