/* Kelua UX Enhancements CSS - Professional User Interface */

/* Scroll Progress */
.scroll-progress-modern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 10001;
  backdrop-filter: blur(10px);
}

.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ddbb76, #ddbb76);
  transition: width 0.1s ease;
  position: relative;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

.scroll-progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.8), transparent);
  transform: translateX(-10px);
  transition: left 0.1s ease;
  filter: blur(2px);
}

/* Toast System */
.toast-container {
  position: fixed;
  top: 120px;
  right: 20px;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 320px;
  max-width: 420px;
  animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(212, 175, 55, 0.2);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.8), transparent);
}

.toast-success { 
  border-color: #2ecc71; 
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(46, 204, 113, 0.3);
}

.toast-success::before {
  background: linear-gradient(90deg, transparent, rgba(46, 204, 113, 0.8), transparent);
}

.toast-error { 
  border-color: #e74c3c;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(231, 76, 60, 0.3);
}

.toast-error::before {
  background: linear-gradient(90deg, transparent, rgba(231, 76, 60, 0.8), transparent);
}

.toast-warning { 
  border-color: #f39c12;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(243, 156, 18, 0.3);
}

.toast-warning::before {
  background: linear-gradient(90deg, transparent, rgba(243, 156, 18, 0.8), transparent);
}

.toast-info { 
  border-color: #3498db;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(52, 152, 219, 0.3);
}

.toast-info::before {
  background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.8), transparent);
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
  font-size: 16px;
  position: relative;
}

.toast-success .toast-icon { 
  background: linear-gradient(135deg, #2ecc71, #27ae60); 
  color: white; 
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.toast-error .toast-icon { 
  background: linear-gradient(135deg, #e74c3c, #c0392b); 
  color: white; 
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.toast-warning .toast-icon { 
  background: linear-gradient(135deg, #f39c12, #e67e22); 
  color: white; 
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.toast-info .toast-icon { 
  background: linear-gradient(135deg, #3498db, #2980b9); 
  color: white; 
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.toast-message {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
}

.toast-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
}

/* Enhanced Forms */
.input-enhanced {
  position: relative;
  margin-bottom: 32px;
}

.input-enhanced input,
.input-enhanced textarea {
  width: 100%;
  padding: 20px 16px 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  font-family: 'Inter', sans-serif;
}

.input-enhanced input:focus,
.input-enhanced textarea:focus {
  outline: none;
  border-color: #d4af37;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 0 0 4px rgba(212, 175, 55, 0.1),
    0 8px 32px rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

.input-enhanced.valid input,
.input-enhanced.valid textarea {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.05);
}

.input-enhanced.invalid input,
.input-enhanced.invalid textarea {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.05);
}

.floating-label {
  position: absolute;
  left: 16px;
  top: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  background: transparent;
  padding: 0 6px;
  font-family: 'Inter', sans-serif;
}

.input-enhanced.focused .floating-label,
.input-enhanced.filled .floating-label {
  top: -12px;
  left: 12px;
  font-size: 13px;
  color: #d4af37;
  background: rgba(0, 0, 0, 0.9);
  font-weight: 600;
  transform: scale(0.95);
}

.input-enhanced.valid .floating-label {
  color: #2ecc71;
}

.input-enhanced.invalid .floating-label {
  color: #e74c3c;
}

.input-feedback {
  position: absolute;
  bottom: -24px;
  left: 4px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-feedback.valid {
  color: #2ecc71;
}

.input-feedback.invalid {
  color: #e74c3c;
}

.input-feedback::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* Button Loading */
.btn.loading {
  pointer-events: none;
  opacity: 0.8;
  cursor: wait;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -50px;
  left: 20px;
  background: linear-gradient(135deg, #d4af37, #f1c40f);
  color: #1a1a1a;
  padding: 12px 16px;
  z-index: 10004;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.4s ease;
  box-shadow: 0 8px 32px rgba(212, 175, 55, 0.4);
  font-size: 14px;
}

.skip-link:focus {
  top: 20px;
  transform: scale(1.05);
}

/* Breadcrumb */
.breadcrumb-modern {
  background: rgba(0, 0, 0, 0.9);
  padding: 16px 0;
  margin-top: 104px;
  backdrop-filter: blur(30px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  font-size: 14px;
  position: relative;
}

.breadcrumb-modern .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.breadcrumb-item {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.breadcrumb-item:hover {
  color: #d4af37;
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-1px);
}

.breadcrumb-separator {
  margin: 0 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

.breadcrumb-current {
  color: #d4af37;
  font-weight: 600;
  background: rgba(212, 175, 55, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

/* Smart Back Button */
.smart-back-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(30px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 4px 16px rgba(212, 175, 55, 0.2);
}

.smart-back-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: #d4af37;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 6px 20px rgba(212, 175, 55, 0.3);
}

.smart-back-btn:active {
  transform: translateY(0) scale(1);
}

/* Ripple Effect */
@keyframes rippleExpand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Enhanced Hover States */
.hover-glow {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
  filter: brightness(1.1);
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .toast {
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    margin: 0 20px;
  }
  
  .toast-container {
    right: 0;
    left: 0;
  }
  
  .smart-back-btn {
    bottom: 100px;
    left: 20px;
    right: 20px;
    text-align: center;
    justify-content: center;
  }
  
  .breadcrumb-modern {
    margin-top: 80px;
    padding: 12px 0;
  }
  
  .input-enhanced {
    margin-bottom: 28px;
  }
  
  .input-enhanced input,
  .input-enhanced textarea {
    padding: 18px 14px 10px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .floating-label {
    top: 18px;
    left: 14px;
  }
  
  .input-enhanced.focused .floating-label,
  .input-enhanced.filled .floating-label {
    top: -10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  .scroll-progress-modern {
    height: 3px;
  }
  
  .toast {
    min-width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 0 12px;
    padding: 16px;
  }
  
  .toast-container {
    top: 90px;
  }
  
  .toast-message {
    font-size: 14px;
  }
  
  .skip-link {
    left: 12px;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .smart-back-btn {
    bottom: 80px;
    left: 12px;
    right: 12px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress-fill,
  .scroll-progress-glow,
  .toast,
  .floating-label,
  .smart-back-btn,
  .breadcrumb-item,
  .input-enhanced input,
  .input-enhanced textarea {
    transition: none !important;
    animation: none !important;
  }
  
  .btn-spinner {
    animation: none !important;
  }
  
  .skeleton {
    animation: none !important;
    background: rgba(255, 255, 255, 0.1);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .toast {
    border-width: 2px;
    background: #000;
  }
  
  .input-enhanced input,
  .input-enhanced textarea {
    border-width: 2px;
    background: #000;
  }
  
  .smart-back-btn {
    border-width: 2px;
    background: #000;
  }
}

/* Print Styles */
@media print {
  .scroll-progress-modern,
  .toast-container,
  .smart-back-btn,
  .breadcrumb-modern,
  .skip-link {
    display: none !important;
  }
} 