@tailwind base;
@tailwind components;
@tailwind utilities;

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

/* ==========================================================================
   GLOBAL CUSTOM STYLES
   ========================================================================== */

.font-playfair {
  font-family: 'Playfair Display', serif;
}

/* Animations */
.animate-fade-in {
  animation: fadeIn 0.8s ease-in;
}

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

/* Card Hover Effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Button Styles */
.btn-primary {
  background: #B45309;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #92400E;
  transform: scale(1.05);
}

/* Navigation Active State */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #B45309;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.text-amber-800::after {
  width: 100%;
}

/* Mobile Menu Transition */
.mobile-menu-transition {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.mobile-menu-transition.open {
    max-height: 500px;
    opacity: 1;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { 
    transform: translateX(100%); 
  }
  to { 
    transform: translateX(0); 
  }
}

/* Loading Spinner */
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #B45309;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Focus States */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #B45309;
  outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
  background: #B45309;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #92400E;
}

/* ==========================================================================
   PRICELIST PAGE SPECIFIC STYLES
   ========================================================================== */

.section-content {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
  opacity: 1;
}

.section-content.minimized {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.minimize-btn {
  transition: transform 0.3s ease;
}

.minimize-btn.rotated {
  transform: rotate(180deg);
}

/* ==========================================================================
   RESPONSIVE DESIGN & UTILITIES
   ========================================================================== */

/* Mobile Menu */
#mobile-menu {
  transition: all 0.3s ease;
}

/* Back to top button */
#back-to-top {
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Dark mode styles */
.dark-mode {
  background-color: #1a202c;
  color: #e2e8f0;
}

.dark-mode .bg-white {
  background-color: #2d3748;
}

.dark-mode .text-gray-800 {
  color: #e2e8f0;
}

.dark-mode .text-gray-600 {
  color: #cbd5e0;
}

.dark-mode .text-gray-400 {
  color: #a0aec0;
}

.dark-mode .border-t {
  border-color: #4a5568;
}

.dark-mode .bg-gray-800 {
  background-color: #1a202c;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .text-5xl {
    font-size: 2.5rem;
  }
  
  .text-4xl {
    font-size: 2rem;
  }
  
  .text-3xl {
    font-size: 1.5rem;
  }
}

/* Print Styles */
@media print {
  nav, footer, button, .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
}

/* Aspect Ratio for Maps */
.aspect-w-16 {
  position: relative;
  padding-bottom: calc(9 / 16 * 100%);
}

.aspect-w-16 > iframe {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
}