/* Custom Styles for Shadhi Filmer Portfolio */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: #0a0a0a;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .font-serif {
  font-family: 'Cormorant Garamond', serif;
  word-spacing: 0.1em;
  font-weight: 600;
}

/* Mobile Touch Optimizations */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  input, textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 0;
  }
}

/* Mobile Menu Styling */
#mobile-menu {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#mobile-menu.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

#mobile-menu:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  animation: fadeInSlideDown 0.3s ease-out;
}

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

/* Mobile Menu Links Hover Effect */
.mobile-menu-link {
  position: relative;
  display: inline-block;
  transition: all 0.3s ease;
}

.mobile-menu-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background-color: #ca8a04;
  transition: transform 0.3s ease;
}

.mobile-menu-link:hover::after,
.mobile-menu-link:active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Hamburger Icon Animation */
#mobile-menu-btn svg path {
  transition: all 0.3s ease;
}

/* Container Responsive */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* Loading State */
.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Masonry Grid Layout - Responsive */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 150px;
  gap: 12px;
}

@media (min-width: 640px) {
  .masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 200px;
    gap: 16px;
  }
}

.masonry-item {
  position: relative;
  overflow: hidden;
}

.masonry-item:nth-child(3n) { 
  grid-row: span 3; 
}

.masonry-item:nth-child(2n) { 
  grid-row: span 2; 
}

.masonry-item:nth-child(5n) { 
  grid-row: span 4; 
}

/* Section Scroll Margin */
section {
  scroll-margin-top: 100px;
}

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

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 10px;
}

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

/* Form Input Color Fix for Date Picker */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* Select Arrow Custom */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Smooth transitions for navbar */
.navbar-scrolled {
  background-color: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(12px);
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

/* Gallery item hover effect */
.masonry-item img {
  transition: transform 0.7s ease;
}

.masonry-item:hover img {
  transform: scale(1.1);
}

.masonry-item .overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.masonry-item:hover .overlay {
  opacity: 1;
}

/* Video Gallery Hover Effects */
.video-item {
  position: relative;
  overflow: hidden;
  background-color: black;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  border-radius: 0;
  aspect-ratio: 16 / 9;
}

.video-item > div {
  width: 100%;
  height: 100%;
}

.video-item iframe {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #000;
  border: none;
}

.video-item video {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #000;
}

.video-item video::-webkit-media-controls {
  background-color: rgba(0, 0, 0, 0.7);
}

.video-item video::cue {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
}

/* Responsive Video Gallery - Mobile (375px - 640px) */
@media (max-width: 640px) {
  #films-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  .video-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    max-height: 280px;
  }
}

/* Responsive Video Gallery - Small Tablet (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  #films-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .video-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 300px;
  }
}

/* Responsive Video Gallery - Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  #films-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .video-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 320px;
  }
}

/* Responsive Video Gallery - Desktop (1025px+) */
@media (min-width: 1025px) {
  #films-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .video-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    transition: transform 0.3s ease;
    min-height: 350px;
  }
  
  .video-item:hover {
    transform: translateY(-5px);
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .video-item {
    max-width: 100%;
    min-height: 400px;
  }
}

/* Responsive Grid Adjustments */
@media (max-width: 768px) {
  .masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 150px;
  }
}

/* Animation Helper Classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
}

.fade-in-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

/* Accessibility Improvements */
a:focus, button:focus {
  outline: 2px solid #c5a059;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  nav, footer, .whatsapp-button, #mobile-menu-btn {
    display: none;
  }
  
  section {
    page-break-inside: avoid;
  }
}

/* Performance Optimizations */
img {
  content-visibility: auto;
}

/* Smooth Image Loading */
img[data-src] {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

img.loaded {
  animation: none;
  background: none;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
  z-index: 9999;
  transition: width 0.1s ease;
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #0a0a0a;
    color: #ffffff;
  }
}


/* Performance Optimizations */
img {
  content-visibility: auto;
}

/* Smooth Image Loading */
img {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
}

img[src] {
  animation: shimmer 1.5s infinite;
}

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

img.loaded {
  animation: none;
  background: none;
}

/* ========== COMPREHENSIVE RESPONSIVE MEDIA QUERIES ========== */

/* Social Media Buttons Responsive */
@media (max-width: 640px) {
  /* Social buttons - smaller on mobile */
  .fixed.bottom-10.right-10 {
    bottom: 1rem !important;
    right: 1rem !important;
  }
  
  .fixed.bottom-10.right-10 a {
    padding: 0.75rem !important;
  }
  
  .fixed.bottom-10.right-10 svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .fixed.bottom-10.right-10 {
    bottom: 1.5rem !important;
    right: 1.5rem !important;
  }
}

/* Hero Section Responsive */
@media (max-width: 480px) {
  section h1 {
    font-size: 2.5rem !important;
    line-height: 1.2;
  }
  
  section h2 {
    font-size: 1.75rem !important;
  }
}

/* Footer Responsive */
@media (max-width: 768px) {
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  footer h3, footer h4 {
    text-align: center;
  }
  
  footer ul {
    text-align: center;
  }
  
  footer p {
    text-align: center;
  }
}

/* Booking Form Responsive */
@media (max-width: 640px) {
  #booking-form {
    padding: 1.5rem !important;
  }
  
  #booking-form input,
  #booking-form select,
  #booking-form textarea {
    font-size: 16px !important;
  }
}

/* Navigation Responsive */
@media (max-width: 768px) {
  nav .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* About Section Stats Responsive */
@media (max-width: 640px) {
  #about .flex {
    gap: 2rem !important;
  }
  
  #about span[class*="text-5xl"],
  #about span[class*="text-6xl"] {
    font-size: 3rem !important;
  }
}

/* Gallery Improvements for Very Small Screens */
@media (max-width: 480px) {
  .masonry-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: 200px;
    gap: 10px;
  }
  
  .masonry-item:nth-child(3n),
  .masonry-item:nth-child(5n) {
    grid-row: span 2;
  }
}

/* Extra Large Screens (2K/4K monitors) */
@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
  
  section {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Landscape Mobile Orientation */
@media (max-width: 896px) and (orientation: landscape) {
  section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  .fixed.bottom-10.right-10 {
    bottom: 0.5rem !important;
    right: 0.5rem !important;
  }
  
  #mobile-menu {
    padding-top: 10vh !important;
  }
}

/* Tablet Portrait Specific */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  #films-container {
    grid-template-columns: 1fr;
  }
}

/* Small mobile devices (iPhone SE, small Android) */
@media (max-width: 375px) {
  body {
    font-size: 13px;
  }
  
  section h1 {
    font-size: 2rem !important;
  }
  
  section h2 {
    font-size: 1.5rem !important;
  }
  
  .fixed.bottom-10.right-10 {
    bottom: 0.75rem !important;
    right: 0.75rem !important;
    gap: 0.5rem !important;
  }
  
  .fixed.bottom-10.right-10 a {
    padding: 0.625rem !important;
  }
  
  .fixed.bottom-10.right-10 svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
  }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
  .container {
    max-width: 1920px;
  }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  .masonry-item:hover .overlay {
    opacity: 0;
  }
  
  .masonry-item:active .overlay {
    opacity: 1;
  }
}
