/**
 * HUNGAMA FESTIVAL - PREMIUM INTERACTION SYSTEM
 * 
 * Apple × Linear × Stripe interaction patterns
 * Hover states, focus rings, motion, affordances
 */

/* ============================================================
   GLOBAL INTERACTIVE STATE MANAGEMENT
   ============================================================ */

/* Reset default interaction styles for full control */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-primary);
  color: var(--color-white);
  background-color: var(--color-surface-primary);
}

/* ============================================================
   GLOBAL FOCUS MANAGEMENT - Premium focus rings
   ============================================================ */

:focus-visible {
  outline: 2px solid rgba(220, 20, 60, 0.8);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(220, 20, 60, 0.8);
  outline-offset: 2px;
}

/* ============================================================
   PREMIUM NAVBAR - Liquid Glass Effect
   ============================================================ */

nav {
  background: linear-gradient(180deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 0, 0, 0.5) 100%);
  backdrop-filter: var(--backdrop-blur-lg);
  border-bottom: 1px solid var(--color-glass-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Navbar scroll hide behavior */
nav.scroll-hide {
  transform: translateY(-100%);
  transition: transform var(--motion-duration-base) var(--ease-out-smooth);
}

nav.scroll-show {
  transform: translateY(0);
  transition: transform var(--motion-duration-base) var(--ease-out-smooth);
}

/* ============================================================
   MOBILE NAVIGATION - Logo + Hamburger Only
   ============================================================ */

@media (max-width: 767px) {
  /* Hide navbar on mobile - only hamburger visible */
  nav {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
  }

  nav.mobile-navbar-visible {
    background: linear-gradient(180deg, 
      rgba(0, 0, 0, 0.95) 0%, 
      rgba(0, 0, 0, 0.85) 100%);
    backdrop-filter: var(--backdrop-blur-xl);
    border-bottom: 1px solid var(--color-glass-2);
  }
}

/* ============================================================
   FLOATING ACTION BUTTON (FAB) - Mobile CTA
   ============================================================ */

.fab-cta {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  z-index: var(--z-popover);
  
  width: 56px;
  height: 56px;
  border-radius: 50%;
  
  background: linear-gradient(135deg, 
    #8B1538 0%, 
    #DC143C 100%);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  font-weight: var(--font-weight-bold);
  color: white;
  text-decoration: none;
  
  box-shadow: 0 8px 24px rgba(220, 20, 60, 0.3);
  
  transition: all var(--motion-duration-base) var(--ease-out-smooth);
  
  /* Hide on desktop */
  display: none;
}

@media (max-width: 767px) {
  .fab-cta {
    display: flex;
  }
  
  .fab-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(220, 20, 60, 0.4);
  }
  
  .fab-cta:active {
    transform: translateY(-2px);
  }
}

/* ============================================================
   BUTTON INTERACTIONS - Press compression & glow
   ============================================================ */

button,
a.button,
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-glass-1);
  
  background-color: transparent;
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  
  cursor: pointer;
  transition: all var(--motion-duration-base) var(--ease-out-smooth);
  
  /* Prevent text selection on click */
  user-select: none;
  -webkit-user-select: none;
}

/* Primary Button State */
button:hover,
a.button:hover,
.btn:hover {
  transform: translateY(-2px);
  background-color: rgba(220, 20, 60, 0.1);
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 0 12px rgba(220, 20, 60, 0.3);
  border-color: rgba(220, 20, 60, 0.6);
  color: rgba(220, 20, 60, 1);
}

button:active,
a.button:active,
.btn:active {
  transform: translateY(0px);
  background-color: rgba(220, 20, 60, 0.15);
}

/* Focus state */
button:focus,
a.button:focus,
.btn:focus {
  outline: 2px solid rgba(220, 20, 60, 0.8);
  outline-offset: 2px;
}

/* Disabled state */
button:disabled,
a.button[aria-disabled="true"],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   CARD INTERACTIONS - Lift, glow, accent edge, shadow
   ============================================================ */

.card,
[data-card],
.nominee-card,
.jury-card,
.archive-item {
  position: relative;
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-secondary);
  border: 1px solid var(--color-glass-1);
  
  transition: all var(--motion-duration-base) var(--ease-out-smooth);
  
  overflow: hidden;
}

.card:hover,
[data-card]:hover,
.nominee-card:hover,
.jury-card:hover,
.archive-item:hover {
  transform: translateY(-8px);
  border-color: rgba(220, 20, 60, 0.5);
  box-shadow: 
    0 16px 32px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(220, 20, 60, 0.2),
    inset 0 0 1px rgba(220, 20, 60, 0.1);
  background-color: var(--color-surface-tertiary);
}

.card:focus-within,
[data-card]:focus-within,
.nominee-card:focus-within,
.jury-card:focus-within,
.archive-item:focus-within {
  border-color: rgba(220, 20, 60, 0.8);
  box-shadow: 
    0 0 0 2px rgba(0, 0, 0, 0.9),
    0 0 0 3px rgba(220, 20, 60, 0.8);
}

/* ============================================================
   IMAGE INTERACTIONS - Fade-in on load + subtle zoom
   ============================================================ */

img {
  opacity: 0;
  transition: opacity var(--motion-duration-slow) var(--ease-out-smooth);
}

img[loading="lazy"]:not([src=""]),
img:not([loading="lazy"]) {
  opacity: 1;
}

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

.card:hover img,
[data-card]:hover img,
.nominee-card:hover img,
.jury-card:hover img {
  transform: scale(1.02);
  transition: transform var(--motion-duration-slow) var(--ease-out-smooth);
}

/* ============================================================
   LINK INTERACTIONS - Underline slide, color shift
   ============================================================ */

a:not(.button):not([class*="btn"]):not([role="button"]) {
  position: relative;
  color: var(--color-white);
  text-decoration: none;
  transition: color var(--motion-duration-base) var(--ease-out-smooth);
  border-bottom: 1px solid transparent;
}

a:hover:not(.button):not([class*="btn"]):not([role="button"]) {
  color: rgba(220, 20, 60, 1);
  border-bottom-color: rgba(220, 20, 60, 0.6);
}

a:focus:not(.button):not([class*="btn"]):not([role="button"]) {
  outline: 2px solid rgba(220, 20, 60, 0.8);
  outline-offset: 2px;
}

/* ============================================================
   INPUT INTERACTIONS - Sacred form experience
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
  background-color: var(--color-surface-secondary);
  border: 1px solid var(--color-glass-1);
  color: var(--color-white);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-family-primary);
  font-size: 1rem;
  
  transition: all var(--motion-duration-base) var(--ease-out-smooth);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover {
  border-color: var(--color-glass-2);
  background-color: var(--color-surface-tertiary);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(220, 20, 60, 0.8);
  background-color: var(--color-surface-tertiary);
  box-shadow: 
    0 0 12px rgba(220, 20, 60, 0.2),
    0 0 0 2px rgba(0, 0, 0, 0.9),
    0 0 0 3px rgba(220, 20, 60, 0.6);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder,
textarea::placeholder {
  color: var(--color-gray-400);
}

/* ============================================================
   CHECKBOX & RADIO INTERACTIONS
   ============================================================ */

input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
  accent-color: rgba(220, 20, 60, 1);
  transition: all var(--motion-duration-base) var(--ease-out-smooth);
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  transform: scale(1.1);
}

/* ============================================================
   TEXT SELECTION - Branded highlight
   ============================================================ */

::selection {
  background-color: rgba(220, 20, 60, 0.3);
  color: var(--color-white);
}

::-moz-selection {
  background-color: rgba(220, 20, 60, 0.3);
  color: var(--color-white);
}

/* ============================================================
   SCROLLBAR STYLING - Custom brand-aligned
   ============================================================ */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-600);
  border-radius: 4px;
  transition: background var(--motion-duration-base);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 20, 60, 0.8);
}

/* Firefox */
* {
  scrollbar-color: var(--color-gray-600) var(--color-surface-secondary);
  scrollbar-width: thin;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS - Touch-friendly on mobile
   ============================================================ */

@media (max-width: 767px) {
  button,
  a.button,
  .btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    min-height: 44px;
  }

  .card,
  [data-card],
  .nominee-card,
  .jury-card,
  .archive-item {
    border-radius: var(--radius-base);
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea {
    min-height: 44px;
    font-size: 16px; /* Prevent iOS zoom on focus */
  }
}

/* ============================================================
   ACCESSIBILITY - Reduced Motion Support
   ============================================================ */

@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;
  }

  button:hover,
  a.button:hover,
  .btn:hover,
  .card:hover,
  [data-card]:hover,
  .nominee-card:hover,
  .jury-card:hover {
    transform: none;
  }
}

/* ============================================================
   HIGH CONTRAST MODE - Accessibility
   ============================================================ */

@media (prefers-contrast: more) {
  button,
  a.button,
  .btn {
    border: 2px solid var(--color-white);
  }

  input[type="text"],
  input[type="email"],
  textarea {
    border: 2px solid var(--color-white);
  }
}

/* ============================================================
   RESPONSIVE TYPOGRAPHY - Optical sizing
   ============================================================ */

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.875rem);
  font-weight: var(--font-weight-semibold);
}

p {
  font-size: 1rem;
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
}

/* ============================================================
   UTILITY - Motion Prefers Reduced
   ============================================================ */

.motion-safe {
  @media (prefers-reduced-motion: reduce) {
    display: none;
  }
}

.motion-reduce {
  @media (prefers-reduced-motion: no-preference) {
    display: none;
  }
}
