/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties */
:root {
  --primary-color: #15803d;
  --primary-hover: #166534;
  --secondary-color: #0d9488;
  --accent-color: #d97706;
  --success-color: #10b981;
  --warning-color: #d97706;
  --error-color: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

/* Utility Classes */
.font-inter {
  font-family: 'Inter', sans-serif;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Navigation */
.nav-link {
  position: relative;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  border-radius: var(--border-radius);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: var(--spacing-md);
  right: var(--spacing-md);
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
}

/* Category Tabs */
.category-tab {
  color: var(--gray-700);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-tab:hover {
  color: var(--primary-color);
}

.category-tab.active {
  background: var(--primary-color);
  color: white;
}

.category-tab:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Mobile Navigation */
.nav-link-mobile {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.nav-link-mobile:hover,
.nav-link-mobile.active {
  background-color: var(--gray-100);
  color: var(--primary-color);
}

.nav-link-mobile.active {
  background-color: #15803d;
  color: white;
}

/* Global Search Styles */
#global-search {
  min-width: 280px;
}

@media (max-width: 768px) {
  #global-search {
    display: none;
  }
}

.search-result-item {
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-result-item:hover,
.search-result-item:focus {
  background-color: #f9fafb;
  transform: translateY(-1px);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item.highlighted {
  background-color: #15803d !important;
  color: white;
  transform: translateY(-1px);
}

.search-result-item.highlighted .font-medium {
  color: white !important;
}

.search-result-item.highlighted .text-gray-500,
.search-result-item.highlighted .text-green-600,
.search-result-item.highlighted .text-red-500 {
  color: rgba(255, 255, 255, 0.8) !important;
}

.search-result-item.highlighted .font-bold {
  color: white !important;
}

/* Clear button styles */
.search-input-container {
  position: relative;
}

.search-input-container input {
  padding-right: 2.5rem; /* Make room for clear button */
}

.search-input-container button {
  /* Clear button is positioned absolutely within the container */
  z-index: 10;
}

/* Mobile tap target enhancement */
@media (max-width: 768px) {
  .search-input-container button {
    width: 40px;
    height: 40px;
    right: 0.25rem;
  }
  
  .search-input-container input {
    padding-right: 3rem; /* More space on mobile */
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .search-input-container button {
    color: #9ca3af;
  }
  
  .search-input-container button:hover {
    color: #d1d5db;
    background-color: #374151;
  }
  
  .search-input-container button:focus {
    background-color: #374151;
    color: #f9fafb;
  }
}

/* Product image hover effects */
.search-result-item img {
  transition: all var(--transition-fast);
}

.search-result-item:hover img {
  transform: scale(1.05);
}

/* Hero Section */
.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e0f2fe' fill-opacity='0.4'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  z-index: 0;
}

.hero-section > .container {
  position: relative;
  z-index: 1;
}

/* Hero Images Grid Styles */
.hero-section .grid img {
  transition: all var(--transition-normal);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.hero-section .grid .group:hover img {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.hero-section .grid .relative {
  overflow: hidden;
  border-radius: 12px;
}

/* Floating Elements Animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
  40%, 43% { transform: translateY(-10px); }
  70% { transform: translateY(-5px); }
  90% { transform: translateY(-2px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-bounce {
  animation: bounce 2s infinite;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Features List Styling */
.hero-section .space-y-3 .flex {
  transition: all var(--transition-fast);
}

.hero-section .space-y-3 .flex:hover {
  transform: translateX(5px);
}

.hero-section .space-y-3 .w-6 {
  transition: all var(--transition-fast);
}

.hero-section .space-y-3 .flex:hover .w-6 {
  transform: scale(1.1);
  background-color: #10b981;
}

.cta-button {
  background: linear-gradient(135deg, #15803d, #166534);
  color: white;
  padding: var(--spacing-lg) var(--spacing-2xl);
  border: none;
  border-radius: var(--border-radius-lg);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Filter Buttons */
.filter-btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 2px solid var(--gray-300);
  background: white;
  color: var(--gray-600);
  border-radius: var(--border-radius-lg);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-btn.active {
  background: #15803d;
  border-color: #15803d;
  color: white;
}

/* Product Cards */
.product-card {
  background: white;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid var(--gray-200);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #15803d;
}

.product-image-container {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-image {
  transform: scale(1.1);
}

.product-badge {
  position: absolute;
  top: var(--spacing-md);
  left: var(--spacing-md);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.product-info {
  padding: var(--spacing-lg);
}

.product-title {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: var(--spacing-sm);
  line-height: 1.4;
}

.product-price {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.current-price {
  font-weight: 700;
  font-size: 1.25rem;
  color: #15803d;
}

.original-price {
  color: var(--gray-400);
  text-decoration: line-through;
  font-size: 0.9rem;
}

/* Gallery Styles */
.gallery-item {
  transition: all var(--transition-normal);
}

.gallery-item:hover {
  transform: translateY(-4px);
}

/* Tourism Page Specific Styles */
.tourism-hero {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 50%, #ecfdf5 100%);
}

.tour-card {
  background: white;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-100);
  transition: all var(--transition-normal);
}

.tour-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
}

.difficulty-badge {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
}

.difficulty-easy {
  background-color: #dcfce7;
  color: #166534;
}

.difficulty-medium {
  background-color: #fed7aa;
  color: #9a3412;
}

.difficulty-hard {
  background-color: #fecaca;
  color: #991b1b;
}

/* CMS Specific Styles */
.cms-sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-right: 1px solid var(--gray-200);
}

.cms-nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
  color: var(--gray-700);
  font-weight: 500;
}

.cms-nav-item:hover {
  background-color: var(--gray-100);
  color: var(--primary-color);
}

.cms-nav-item.active {
  background-color: #15803d;
  color: white;
}

.cms-card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
}

.cms-card:hover {
  box-shadow: var(--shadow-md);
}

.cms-form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.cms-form-input:focus {
  outline: none;
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

.cms-btn-primary {
  background: #15803d;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cms-btn-primary:hover {
  background: #166534;
  transform: translateY(-1px);
}

.cms-btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cms-btn-secondary:hover {
  background: var(--gray-200);
}

.cms-stats-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
}

.cms-stats-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .hero-section .col-span-2 {
    grid-column: span 1;
  }
  
  .hero-section .absolute {
    display: none !important;
  }
  
  .container {
    padding: 0 var(--spacing-md);
  }

  .filter-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.9rem;
  }

  .tour-card {
    margin-bottom: var(--spacing-lg);
  }

  .cms-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

  .cms-sidebar.active {
    transform: translateX(0);
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: var(--spacing-2xl) 0;
  }
  
  .product-card {
    margin-bottom: var(--spacing-lg);
  }
  
  .cta-button {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
  }

  .tour-card .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tour-card .lg\\:col-span-2 {
    grid-column: span 1;
  }

  .cms-stats-card {
    padding: 1rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

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

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* Focus States */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .product-card {
    border: 2px solid var(--gray-800);
  }
}

/* Advanced Filter Styles */
.slider::-webkit-slider-thumb {
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #15803d;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #15803d;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-webkit-slider-track {
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
}

.slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  border: none;
}

.slider:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

/* Filter chip animations */
.filter-chip-enter {
  animation: chipEnter 0.2s ease-out;
}

@keyframes chipEnter {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Advanced filter panel animation */
#advanced-filter-panel {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

/* Filter tag button states */
.filter-tag {
  padding: 0.5rem 1rem;
  border: 2px solid var(--gray-300);
  background: white;
  color: var(--gray-600);
  border-radius: 9999px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
}

.filter-tag:hover {
  border-color: #16a34a;
  color: #15803d;
}

.filter-tag.active {
  background-color: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}

.filter-tag:focus {
  outline: 2px solid #15803d;
  outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hero-image,
  .hero-image-secondary,
  .product-image {
    transform: none !important;
  }
  
  #advanced-filter-panel {
    transition: none !important;
  }
}

/* Tourism specific styles */
.bg-red-500 { background-color: #ef4444; }
.bg-green-500 { background-color: #10b981; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-purple-500 { background-color: #8b5cf6; }
.bg-yellow-500 { background-color: #eab308; }
.bg-indigo-500 { background-color: #6366f1; }

/* CMS Specific Styles */
.quick-action-btn {
  @apply flex flex-col items-center justify-center p-6 bg-gray-50 hover:bg-gray-100 rounded-xl transition-colors cursor-pointer border-2 border-transparent hover:border-green-200;
}

.nav-item.tab-active {
  background-color: #15803d;
  color: white;
}

.nav-item.tab-inactive {
  background-color: #f3f4f6;
  color: #6b7280;
}

.sidebar-active {
  transform: translateX(0);
}

.sidebar-inactive {
  transform: translateX(-100%);
}

/* Product preview card */
.product-card {
  transition: all var(--transition-fast);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Toast animations */
.toast-enter {
  transform: translateX(100%);
}

.toast-enter-active {
  transform: translateX(0);
  transition: transform 0.3s ease-out;
}

.toast-exit {
  transform: translateX(0);
}

.toast-exit-active {
  transform: translateX(100%);
  transition: transform 0.3s ease-in;
}

/* Form validation styles */
.form-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-success {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Modal backdrop */
.modal-backdrop {
  backdrop-filter: blur(4px);
}

/* Responsive CMS layout */
@media (max-width: 1024px) {
  .sidebar-inactive {
    transform: translateX(-100%);
  }
  
  .sidebar-active {
    transform: translateX(0);
  }
}

/* Dark mode support for CMS */
@media (prefers-color-scheme: dark) {
  .cms-card {
    background-color: #1f2937;
    border-color: #374151;
  }
  
  .cms-form-input {
    background-color: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }
  
  .cms-form-input:focus {
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
  }
}