/**
 * Custom CSS styles for Butik Putri website
 * Extends Tailwind CSS and DaisyUI with custom styling
 */

/* Custom color scheme inspired by minimalist design */
:root {
  --primary-color: #2d3748;
  --secondary-color: #4a5568;
  --accent-color: #718096;
  --background-color: #f7fafc;
  --text-color: #1a202c;
  --border-color: #e2e8f0;
}

/* Base styles */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
}

/* Custom button hover effects */
.btn:hover {
  transform: translateY(-1px);
  transition: all 0.2s ease-in-out;
}

/* Card hover effects */
.card:hover {
  transform: translateY(-2px);
  transition: all 0.3s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Loading animation for images */
img {
  transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Custom form styles */
.form-control input:focus,
.form-control textarea:focus,
.form-control select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
}

/* Wishlist button animation */
.wishlist-btn {
  transition: all 0.2s ease-in-out;
}

.wishlist-btn:hover {
  transform: scale(1.1);
}

.wishlist-btn.active {
  color: #ef4444;
}

/* Hero section gradient */
.hero {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

/* Product grid responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-body {
    padding: 1rem;
  }
}

/* Admin dashboard specific styles */
.admin-sidebar {
  background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
}

.admin-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
}

.admin-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Stats cards */
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Table styles */
.admin-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-table th {
  background: #f7fafc;
  font-weight: 600;
  color: #2d3748;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.admin-table tr:hover {
  background: #f8fafc;
}

/* Modal animations */
.modal {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Chatbot styles */
.chat-bubble {
  max-width: 80%;
  word-wrap: break-word;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Responsive design improvements */
@media (max-width: 640px) {
  .hero-content {
    padding: 2rem 1rem;
  }

  .text-5xl {
    font-size: 2.5rem;
  }

  .card-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .btn,
  .chatbot-toggle,
  .modal {
    display: none !important;
  }

  .container {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better accessibility */
.btn:focus,
.input:focus,
.textarea:focus,
.select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--border-color);
  }

  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  [data-theme="dark"] {
    --background-color: #1a202c;
    --text-color: #f7fafc;
    --border-color: #2d3748;
  }
}
