/* Modal component styles for Ten Z Vault */

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Modal container */
.modal {
  background: white;
  border-radius: 16px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.modal-backdrop.active .modal {
  transform: scale(1) translateY(0);
}

/* Modal header */
.modal-header {
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #6b7280;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.1);
}

.modal-close i {
  font-size: 1.25rem;
}

/* Modal body */
.modal-body {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modal footer */
.modal-footer {
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  background: #f8fafc;
}

.modal-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.modal-button-primary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
}

.modal-button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.modal-button-secondary {
  background: white;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.modal-button-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Product modal specific styles */
.product-modal .modal {
  max-width: 800px;
}

.product-modal .modal-body {
  padding: 0;
}

.product-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

.product-image {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-image:hover img {
  transform: scale(1.05);
}

.product-details h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 1rem;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.product-stars {
  display: flex;
  color: #fbbf24;
}

.product-rating-text {
  color: #6b7280;
  font-size: 0.9rem;
}

.product-description {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.product-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.product-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #4b5563;
}

.product-features i {
  color: #10b981;
  font-size: 0.875rem;
}

/* Image gallery modal */
.gallery-modal .modal {
  max-width: 90vw;
  max-height: 90vh;
}

.gallery-modal .modal-body {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.gallery-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #1f2937;
}

.gallery-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-prev {
  left: 2rem;
}

.gallery-nav-next {
  right: 2rem;
}

/* Confirmation modal */
.confirm-modal .modal {
  max-width: 400px;
}

.confirm-modal .modal-body {
  text-align: center;
  padding: 2rem;
}

.confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.confirm-icon.warning {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.confirm-icon.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.confirm-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.confirm-message {
  color: #4b5563;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Loading modal */
.loading-modal .modal {
  max-width: 300px;
}

.loading-modal .modal-body {
  text-align: center;
  padding: 3rem 2rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-text {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .modal-backdrop {
    padding: 0.5rem;
  }
  
  .modal {
    max-width: none;
    width: calc(100% - 1rem);
    margin: 0 0.5rem;
  }
  
  .modal-header {
    padding: 1rem 1.5rem 0.75rem;
  }
  
  .modal-title {
    font-size: 1.25rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .modal-footer {
    padding: 0.75rem 1.5rem 1rem;
    flex-direction: column-reverse;
  }
  
  .modal-button {
    width: 100%;
  }
  
  .product-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  
  .gallery-nav {
    width: 40px;
    height: 40px;
  }
  
  .gallery-nav-prev {
    left: 1rem;
  }
  
  .gallery-nav-next {
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .modal {
    border-radius: 12px;
  }
  
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-title {
    font-size: 1.125rem;
  }
  
  .modal-close {
    width: 35px;
    height: 35px;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-footer {
    padding: 0.75rem 1rem;
  }
  
  .product-details h2 {
    font-size: 1.5rem;
  }
  
  .gallery-nav {
    width: 35px;
    height: 35px;
  }
}

/* Accessibility */
.modal:focus {
  outline: none;
}

.modal-close:focus,
.modal-button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .modal {
    border: 2px solid #000;
  }
  
  .modal-header,
  .modal-footer {
    background: #f0f0f0;
    border-color: #000;
  }
  
  .modal-title {
    color: #000;
    background: none;
    -webkit-text-fill-color: #000;
  }
  
  .modal-close {
    background: #fff;
    border: 1px solid #000;
    color: #000;
  }
  
  .modal-button-primary {
    background: #000;
    color: #fff;
  }
  
  .modal-button-secondary {
    background: #fff;
    color: #000;
    border-color: #000;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal {
    transition: none;
  }
  
  .modal-backdrop.active .modal {
    transform: none;
  }
  
  .modal-close,
  .modal-button,
  .gallery-nav {
    transition: none;
  }
  
  .loading-spinner {
    animation: none;
  }
}

/* Dark theme */
.dark .modal {
  background: #1f2937;
  color: #f9fafb;
}

.dark .modal-header {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border-color: #4b5563;
}

.dark .modal-footer {
  background: #374151;
  border-color: #4b5563;
}

.dark .modal-close {
  background: rgba(0, 0, 0, 0.3);
  color: #d1d5db;
}

.dark .modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.dark .modal-button-secondary {
  background: #374151;
  color: #d1d5db;
  border-color: #6b7280;
}

.dark .modal-button-secondary:hover {
  background: #4b5563;
}

/* Print styles */
@media print {
  .modal-backdrop {
    display: none;
  }
}
