/* ==========================================================================
   NOVI SVET PRI STOLNICI
   Custom CSS Foundation File
   ========================================================================== */

/* 1. CSS Custom Properties */
:root {
  /* Core Palette */
  --navy: #071D26;
  --ivory: #F4EFE6;
  --terracotta: #B55236;
  --brass: #B49A65;
  --olive: #3C4637;
  --seafoam: #7A9E8E;

  /* Transparency Variants */
  --navy-10: rgba(7, 29, 38, 0.1);
  --navy-30: rgba(7, 29, 38, 0.3);
  --navy-70: rgba(7, 29, 38, 0.7);
  --navy-90: rgba(7, 29, 38, 0.9);
  
  --terracotta-10: rgba(181, 82, 54, 0.1);
  --terracotta-80: rgba(181, 82, 54, 0.8);
  
  --brass-10: rgba(180, 154, 101, 0.1);
  --brass-50: rgba(180, 154, 101, 0.5);

  --ivory-50: rgba(244, 239, 230, 0.5);
  --ivory-90: rgba(244, 239, 230, 0.9);

  /* Typography */
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Manrope', sans-serif;

  /* Timing & Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s ease;
  --transition-slow: 0.6s ease;
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Base resets handled by Tailwind, custom typography globals */
body {
  font-family: var(--font-body);
  color: var(--navy);
  background-color: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
}

/* 2. Alpine.js FOUC prevention */
[x-cloak] { 
  display: none !important; 
}

/* 3. Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left { transform: translateX(-30px); translateY: 0; }
.reveal-left.revealed { transform: translateX(0); }

.reveal-right { transform: translateX(30px); translateY: 0; }
.reveal-right.revealed { transform: translateX(0); }

.reveal-scale { transform: scale(0.95); translateY: 0; }
.reveal-scale.revealed { transform: scale(1); }

/* Staggered delays */
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* 4. Navigation Transitions */
.nav-base {
  transition: background-color var(--transition-normal), 
              padding var(--transition-normal),
              box-shadow var(--transition-normal),
              color var(--transition-normal);
}

.nav-transparent {
  background-color: var(--ivory);
  color: var(--navy);
  box-shadow: none;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.nav-solid {
  background-color: var(--ivory);
  color: var(--navy);
  box-shadow: 0 4px 20px rgba(7, 29, 38, 0.05);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav-dark {
  background-color: var(--navy);
  color: var(--ivory);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* 5. Hero Section Effects */
.hero-overlay {
  background: linear-gradient(to bottom, var(--navy-70), var(--navy-30));
  position: absolute;
  inset: 0;
  z-index: 10;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 6rem);
  letter-spacing: 0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  line-height: 1.1;
}

@keyframes float-indicator {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(10px); opacity: 1; }
}

.scroll-indicator {
  animation: float-indicator 2.5s ease-in-out infinite;
}

/* 6. Texture & Atmosphere */
.texture-grain {
  position: relative;
}

.texture-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  z-index: 50;
  /* Simple SVG grain */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.texture-paper {
  background-color: var(--ivory);
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' result='noise' /%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.03 0' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23paper)' /%3E%3C/svg%3E");
}

.glass-effect {
  background-color: var(--ivory-50);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-effect-dark {
  background-color: var(--navy-70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 7. Decorative Elements */
.divider-wave {
  display: block;
  width: 120px;
  height: 20px;
  margin: 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' fill='none' stroke='%23B49A65' stroke-width='1.5'%3E%3Cpath d='M0,6 C15,6 15,1 30,1 C45,1 45,11 60,11 C75,11 75,1 90,1 C105,1 105,6 120,6' /%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.divider-ornament::before,
.divider-ornament::after {
  content: "";
  height: 1px;
  width: 40px;
  background-color: var(--brass-50);
}

.divider-ornament span {
  display: block;
  width: 6px;
  height: 6px;
  /* rotate diamond */
  transform: rotate(45deg);
  background-color: var(--brass);
}

.accent-line {
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--brass);
  transition: width var(--transition-normal);
}

*:hover > .accent-line {
  width: 80px;
}

/* 8. Gallery & Lightbox */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 300px;
    gap: 1.5rem;
  }
  
  /* Example editorial layout spans */
  .gallery-item:nth-child(1) { grid-column: span 8; grid-row: span 2; }
  .gallery-item:nth-child(2) { grid-column: span 4; grid-row: span 1; }
  .gallery-item:nth-child(3) { grid-column: span 4; grid-row: span 1; }
  .gallery-item:nth-child(4) { grid-column: span 6; grid-row: span 1; }
  .gallery-item:nth-child(5) { grid-column: span 6; grid-row: span 1; }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 29, 38, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* 9. Form Styling */
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--navy-30);
  padding: 0.75rem 0;
  color: var(--navy);
  font-family: var(--font-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  border-radius: 0; /* Reset iOS */
}

/* Textarea specifically */
.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-bottom-color: var(--brass);
  box-shadow: 0 1px 0 0 var(--brass);
}

.form-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-70);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.form-group {
  margin-bottom: 2rem;
}

/* Dark mode inputs (e.g. over navy) */
.form-dark .form-input, 
.form-dark .form-select, 
.form-dark .form-textarea {
  color: var(--ivory);
  border-bottom-color: rgba(244, 239, 230, 0.3);
}

.form-dark .form-input:focus, 
.form-dark .form-select:focus, 
.form-dark .form-textarea:focus {
  border-bottom-color: var(--brass);
  box-shadow: 0 1px 0 0 var(--brass);
}

.form-dark .form-label {
  color: var(--ivory-50);
}

/* Custom Calendar Input resets */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}
input[type="date"]:focus::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* 10. Mobile Action Bar */
.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--ivory);
  box-shadow: 0 -4px 20px rgba(7, 29, 38, 0.1);
  z-index: 40;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 1024px) {
  .mobile-action-bar {
    display: none;
  }
}

.mobile-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  border-right: 1px solid var(--navy-10);
}

.mobile-action-btn:last-child {
  border-right: none;
}

.mobile-action-btn svg {
  margin-bottom: 0.25rem;
  color: var(--brass);
}

/* 11. Menu Tabs */
.menu-tabs-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  border-bottom: 1px solid var(--navy-10);
  margin-bottom: 2rem;
  display: flex;
  white-space: nowrap;
}

.menu-tabs-container::-webkit-scrollbar {
  display: none; /* WebKit */
}

.menu-tab {
  display: inline-block;
  padding: 1rem 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-70);
  position: relative;
  transition: color var(--transition-fast);
  cursor: pointer;
}

.menu-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--brass);
  transform: scaleX(0);
  transition: transform var(--transition-fast) ease-out;
  transform-origin: center;
}

.menu-tab:hover {
  color: var(--navy);
}

.menu-tab-active {
  color: var(--brass);
}

.menu-tab-active::after {
  transform: scaleX(1);
}

/* 12. Presentation Mode */
.presentation-mode .presentation-callout {
  display: flex;
}

.presentation-callout {
  display: none; /* Hidden by default */
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background-color: var(--terracotta);
  color: white;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(181, 82, 54, 0.4);
  z-index: 100;
  cursor: help;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { box-shadow: 0 0 0 0 rgba(181, 82, 54, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(181, 82, 54, 0); }
  100% { box-shadow: 0 0 0 0 rgba(181, 82, 54, 0); }
}

.callout-text {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: var(--navy);
  color: white;
  width: max-content;
  max-width: 280px;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: normal;
  text-align: left;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Triangle pointer */
.callout-text::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent var(--navy) transparent;
}

.presentation-callout:hover .callout-text {
  opacity: 1;
  transform: translateX(-50%) translateY(5px);
  pointer-events: auto;
}

/* 13. Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 29, 38, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background-color: var(--ivory);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  /* Entrance animation handled by Alpine mostly, but fallback classes: */
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

/* 14. Parallax Section */
.parallax-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Enable fixed background only where supported well (exclude mobile Safari generally via supports if possible or media queries) */
@media (min-width: 1024px) {
  @supports (background-attachment: fixed) {
    .parallax-bg {
      background-attachment: fixed;
    }
  }
}

/* 15. Hover Effects */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(7, 29, 38, 0.1);
}

.hover-zoom {
  overflow: hidden;
}

.hover-zoom img {
  transition: transform var(--transition-slow);
}

.hover-zoom:hover img {
  transform: scale(1.03);
}

.link-underline {
  position: relative;
  text-decoration: none;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: currentColor;
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* 16. Responsive Utilities */
.section-padding {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

@media (min-width: 1024px) {
  .section-padding {
    padding-top: 8rem;
    padding-bottom: 8rem;
  }
}

/* Fluid typography utilities */
.text-fluid-h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.1; }
.text-fluid-h2 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.2; }
.text-fluid-h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.3; }

/* 17. Print Styles */
@media print {
  nav, footer, .mobile-action-bar, .modal-overlay, .presentation-callout, .hero-overlay {
    display: none !important;
  }
  
  body {
    background-color: white !important;
    color: black !important;
    font-size: 12pt;
  }
  
  .glass-effect, .texture-paper {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
  }
  
  /* Show links */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* Prevent breaks inside items */
  .gallery-item, .menu-item {
    page-break-inside: avoid;
  }
}

/* 18. Reduced 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;
  }
  
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
  
  .parallax-bg {
    background-attachment: scroll !important;
  }
  
  .hover-lift:hover {
    transform: none !important;
  }
  
  .hover-zoom:hover img {
    transform: none !important;
  }
}

/* 19. Scrollbar Styling */
/* WebKit */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--navy);
}

::-webkit-scrollbar-thumb {
  background: var(--brass-50);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brass);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--brass-50) var(--navy);
}

/* 20. Special Section Backgrounds */
.bg-experience {
  background-color: var(--navy);
  background-image: radial-gradient(circle at top right, var(--navy-30) 0%, transparent 50%),
                    radial-gradient(circle at bottom left, var(--olive) 0%, transparent 40%);
  color: var(--ivory);
}

.bg-lunch {
  background-color: var(--ivory);
  position: relative;
}

.bg-lunch::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, var(--olive) 0, var(--olive) 1px, transparent 1px, transparent 20px);
  opacity: 0.03;
  pointer-events: none;
}

.bg-reservation {
  background: linear-gradient(135deg, var(--ivory) 0%, var(--terracotta-10) 100%);
}
