/* Custom CSS for Café Zelatte */

/* Base Styles */
:root {
  --color-primary: #e1ece2;
  --color-primary-dark: #c5d9c7;
  --color-secondary: #b0a3b8;
  --color-secondary-dark: #978a9f;
  --color-accent: #2cdbdb;
  --color-accent-dark: #24b5b5;
  --color-neutral: #e8eaed;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Custom Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes float-delayed {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float-delayed 8s ease-in-out infinite;
  animation-delay: 1s;
}

/* Header Scroll Effect */
#header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Smooth Transitions */
a, button {
  transition: all 0.3s ease;
}

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

#mobile-menu.active {
  max-height: 500px;
}

/* Back to Top Button */
#back-to-top {
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

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

/* Form Styles */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(44, 219, 219, 0.1);
}

/* Loading State for Form */
form.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success/Error Messages */
.form-success {
  color: #10b981;
  background-color: #d1fae5;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #10b981;
}

.form-error {
  color: #ef4444;
  background-color: #fee2e2;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #ef4444;
}

/* Image Optimization */
img {
  max-width: 100%;
  height: auto;
}

/* Lazy Loading Effect */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
}

/* Responsive Typography */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-dark);
}

/* Prevent FOUC (Flash of Unstyled Content) */
.no-js {
  opacity: 1;
}

/* Print Styles */
@media print {
  #header,
  #back-to-top,
  #mobile-menu-btn {
    display: none;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Accessibility - Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --color-accent: #00a8a8;
  }
}

/* Dark Mode Support (Optional - for future implementation) */
@media (prefers-color-scheme: dark) {
  /* Will be implemented if needed */
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Intersection Observer Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Grid Gap Fallback for older browsers */
@supports not (gap: 1rem) {
  .grid > * {
    margin-bottom: 1rem;
  }
}
