/**
 * File: assets/css/digital-signage-styles.css
 * Digital signage display styles - v8 (Fixed QR Code & Positioning)
 */

/* Import Google Font for "Show Some Love" text */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes:wght@400&display=swap');

/* ==========================================================================
   Base & Transitions
   ========================================================================== */

.as-signage-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    cursor: none;
}

.as-spotlight-display,
.as-featured-display {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

.as-spotlight-display.active,
.as-featured-display.active {
    opacity: 1;
}

/* ==========================================================================
   FIXED: Spotlight Display Layout - EQUAL DISTANCE FROM EDGES
   ========================================================================== */

.as-spotlight-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #181743;
}

.as-spotlight-image img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}



/* FIXED: Bubbles Container */
.as-bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.as-bubbles-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    overflow: visible;
}

#bubbleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    z-index: 2;
    pointer-events: none;
}
.as-bubble {
    position: absolute;
    bottom: -50px;
    border-radius: 50%;
    background: rgba(135, 206, 250, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    opacity: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    animation-name: as-bubble-float;
    animation-timing-function: ease-out;
    animation-iteration-count: infinite;
}

.as-bubble-svg {
    fill: rgba(135, 206, 250, 0.15);
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2;
    opacity: 5;
    animation: as-bubble-float linear infinite;
    transform-origin: center bottom;
}

@keyframes as-bubble-float {
    0% {
        transform: translate3d(0, 0, 0) scale(0.3);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    50% {
        transform: translate3d(0, -50vh, 0) scale(0.8);
        opacity: 0.9;
    }
    90% {
        transform: translate3d(0, -90vh, 0) scale(1.2);
        opacity: 0.4;
    }
    100% {
        transform: translate3d(0, -100vh, 0) scale(1.5);
        opacity: 0;
    }
}

.as-spotlight-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
}

/* FIXED: Spotlight details - EQUAL DISTANCE (60px from left = 60px from bottom) */
.as-spotlight-details {
    position: absolute;
    bottom: 60px; /* CHANGED back to 60px to match left distance */
    left: 60px;
    right: auto;
    max-width: 800px;
    padding: 40px 50px;
    color: white;
    transform: translateY(100%);
    opacity: 0;
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 99999;
    background: rgba(24, 23, 67, 0.85);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    /*border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);*/
    border-top: 1px solid transparent;

}

.as-spotlight-details.animate-in {
    transform: translateY(0);
    opacity: 1;
}

.as-spotlight-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 16px 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1.1;
}

.as-spotlight-info h2 {
    font-size: 36px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.2;
    color: white;
}

.as-spotlight-info p {
    font-size: 20px;
    line-height: 1.4;
    margin: 0 0 20px 0;
    color: rgba(255, 255, 255, 0.95);
}

.as-spotlight-meta {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 20px;
}

.as-spotlight-size-display,
.as-vote-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 1.0);
    color: #181743;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.as-vote-item i {
    font-size: 20px;
    color: #f38221;
}

.as-vote-label {
    margin-left: 6px;
    color: #181743;
    font-size: 18px;
}

.as-spotlight-size-display {
    color: #181743;
}

.as-spotlight-size-display i {
    color: #181743;
    font-size: 20px;
}

.as-spotlight-votes-display {
    display: flex;
    align-items: center;
}

.as-vote-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#spotlight-hearts {
    font-size: 18px;
    font-weight: 700;
    color: #181743;
}

/* ==========================================================================
   FIXED: Featured Display - PROPER FORMATTING & BUTTON STYLE URL
   ========================================================================== */

.as-featured-display {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.as-particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.as-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #f38221 0%, #ff9642 70%, #ffb366 100%);
    opacity: 0;
    animation: as-particle-float linear infinite;
    box-shadow: 0 0 20px rgba(243, 130, 33, 0.8);
    bottom: -10px;
}

@keyframes as-particle-float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* FIXED: Featured banner formatting */
.as-featured-banner {
  background: rgba(24, 23, 67, 0.85);
  padding: 60px 80px;
  width: 100vw;
  text-align: center;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  backdrop-filter: blur(20px);
 /* border-top: 2px solid rgba(243, 130, 33, 0.3);
  border-bottom: 2px solid rgba(243, 130, 33, 0.3);*/
  overflow: hidden;
  box-sizing: border-box;
  /*border-radius: 24px;*/
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.as-featured-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: as-banner-shine 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes as-banner-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* FIXED: Solid gold text with shimmer */
.as-featured-text h1 {
    font-size: 72px;
    font-weight: 900;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    line-height: 1;
    color: #FFD700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 4px 15px rgba(0,0,0,0.5);
    animation: as-gold-shimmer 3s ease-in-out infinite;
}

@keyframes as-gold-shimmer {
    0%, 100% { 
        color: #FFD700;
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.6),
            0 4px 15px rgba(0,0,0,0.5);
    }
    50% { 
        color: #FFA500;
        text-shadow: 
            0 0 15px rgba(255, 165, 0, 1),
            0 0 25px rgba(255, 215, 0, 0.8),
            0 4px 15px rgba(0,0,0,0.5);
    }
}

.as-featured-subtitle {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.as-featured-instructions {
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 30px 0;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    line-height: 1.4;
}

/* FIXED: URL as orange button style */
.as-featured-url {
    display: inline-block;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
    background: linear-gradient(135deg, #f38221 0%, #ff9642 100%);
    padding: 18px 36px;
    border-radius: 50px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    box-shadow: 
        0 8px 25px rgba(243, 130, 33, 0.4),
        0 0 0 3px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.as-featured-url::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: as-url-shine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes as-url-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.as-featured-url:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 35px rgba(243, 130, 33, 0.5),
        0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   FIXED: Floating Hearts Animation
   ========================================================================== */

.as-floating-heart {
    position: absolute;
    bottom: 0;
    color: #ff4d6d;
    opacity: 0;
    pointer-events: none;
    z-index: 99990;
    font-size: 32px;
    text-shadow: 
        0 0 25px rgba(255, 255, 255, 0.9), 
        0 0 35px rgba(255, 77, 109, 0.8),
        0 2px 8px rgba(0,0,0,0.6);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transform: translate(-50%, 0); /* Still needed for rotation centering */
}

/* ==========================================================================
   FIXED: QR Code Containers - PROPER POSITIONING
   ========================================================================== */

/* FIXED: Vote QR code container with proper label positioning */
#vote-qr-code-container {
    position: absolute;
    bottom: 60px;
    right: 60px;
    background: rgba(255, 255, 255, 0.98);
    padding: 20px 25px 25px 25px; /* Extra top padding for label */
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 1s ease;
    backdrop-filter: blur(15px);
    z-index: 100;
    border: 2px solid rgba(255, 255, 255, 0.8);
    min-width: 200px;
    min-height: 200px;
    display: block;
}

#spotlight-display.active #vote-qr-code-container {
    opacity: 1;
    transition: opacity 1s ease 3s;
}


/* FIXED: "Show Some Love" label positioned inside container at top */
.as-vote-qr-label {
    position: absolute;
    top: -35px; /* Position above the container */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.95);
    color: #ff69b4;
    padding: 10px 18px;
    border-radius: 15px;
    font-family: 'Segoe UI', 'Arial', sans-serif; /* CHANGED: More readable font */
    font-size: 22px; /* INCREASED: Slightly bigger for better readability */
    font-weight: 700; /* BOLD: Much more readable */
    white-space: nowrap;
    border: 2px solid rgba(255, 105, 180, 0.6);
    text-shadow: 0 3px 10px rgba(0,0,0,0.9); /* STRONGER: Better contrast */
    letter-spacing: 1.5px;
    z-index: 101;
    text-transform: uppercase; /* ADDED: Helps with readability */
    backdrop-filter: blur(5px); /* ADDED: Better background separation */
}

#vote-qr-code-container canvas {
    display: block;
    width: 160px !important;
    height: 160px !important;
    margin: 10px auto 0;
}

#featured-qr-code-container {
    position: absolute;
    bottom: 8vh;
    right: 8vw;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(243, 130, 33, 0.3);
}

.as-qr-label {
    text-align: center;
    font-weight: 700;
    color: #181743;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#featured-qr-code-container canvas {
    display: block;
}

/* Vote update animation */
.as-vote-item.as-vote-updated {
    animation: as-vote-flash 0.8s ease-in-out;
}

@keyframes as-vote-flash {
    0%, 100% { 
        background-color: rgba(255, 255, 255, 1.0); 
        transform: scale(1);
    }
    50% { 
        background-color: rgba(243, 130, 33, 0.8); 
        transform: scale(1.1); 
        color: white;
    }
}

/* ==========================================================================
   Error State
   ========================================================================== */

.as-signage-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    z-index: 1000;
    background: rgba(0,0,0,0.8);
    padding: 40px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* ==========================================================================
   Particle positioning classes (DOUBLED)
   ========================================================================== */

.as-particle.pos-0 { left: 0%; }
.as-particle.pos-1 { left: 2.5%; }
.as-particle.pos-2 { left: 5%; }
.as-particle.pos-3 { left: 7.5%; }
.as-particle.pos-4 { left: 10%; }
.as-particle.pos-5 { left: 12.5%; }
.as-particle.pos-6 { left: 15%; }
.as-particle.pos-7 { left: 17.5%; }
.as-particle.pos-8 { left: 20%; }
.as-particle.pos-9 { left: 22.5%; }
.as-particle.pos-10 { left: 25%; }
.as-particle.pos-11 { left: 27.5%; }
.as-particle.pos-12 { left: 30%; }
.as-particle.pos-13 { left: 32.5%; }
.as-particle.pos-14 { left: 35%; }
.as-particle.pos-15 { left: 37.5%; }
.as-particle.pos-16 { left: 40%; }
.as-particle.pos-17 { left: 42.5%; }
.as-particle.pos-18 { left: 45%; }
.as-particle.pos-19 { left: 47.5%; }
.as-particle.pos-20 { left: 50%; }
.as-particle.pos-21 { left: 52.5%; }
.as-particle.pos-22 { left: 55%; }
.as-particle.pos-23 { left: 57.5%; }
.as-particle.pos-24 { left: 60%; }
.as-particle.pos-25 { left: 62.5%; }
.as-particle.pos-26 { left: 65%; }
.as-particle.pos-27 { left: 67.5%; }
.as-particle.pos-28 { left: 70%; }
.as-particle.pos-29 { left: 72.5%; }
.as-particle.pos-30 { left: 75%; }
.as-particle.pos-31 { left: 77.5%; }
.as-particle.pos-32 { left: 80%; }
.as-particle.pos-33 { left: 82.5%; }
.as-particle.pos-34 { left: 85%; }
.as-particle.pos-35 { left: 87.5%; }
.as-particle.pos-36 { left: 90%; }
.as-particle.pos-37 { left: 92.5%; }
.as-particle.pos-38 { left: 95%; }
.as-particle.pos-39 { left: 97.5%; }
.as-particle.pos-40 { left: 100%; }

/* Particle size classes */
.as-particle.size-1 { width: 4px; height: 4px; }
.as-particle.size-2 { width: 7px; height: 7px; }
.as-particle.size-3 { width: 10px; height: 10px; }

/* Particle speed classes */
.as-particle.speed-1 { animation-duration: 18s; }
.as-particle.speed-2 { animation-duration: 12s; }
.as-particle.speed-3 { animation-duration: 8s; }

/* Particle delay classes */
.as-particle.delay-0 { animation-delay: 0s; }
.as-particle.delay-1 { animation-delay: 1s; }
.as-particle.delay-2 { animation-delay: 2s; }
.as-particle.delay-3 { animation-delay: 3s; }
.as-particle.delay-4 { animation-delay: 4s; }
.as-particle.delay-5 { animation-delay: 5s; }
.as-particle.delay-6 { animation-delay: 6s; }
.as-particle.delay-7 { animation-delay: 7s; }
.as-particle.delay-8 { animation-delay: 8s; }
.as-particle.delay-9 { animation-delay: 9s; }
.as-particle.delay-10 { animation-delay: 10s; }

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

.as-spotlight-image,
.as-featured-display,
.as-bubbles-svg,
.as-particles-container {
    will-change: transform, opacity;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .as-bubble-svg,
    .as-particle,
    .as-floating-heart,
    .as-featured-banner::before {
        animation: none;
    }
    
    .as-spotlight-details {
        transition: opacity 0.3s ease;
        transform: translateY(0);
    }
}

/*html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden !important;
  overscroll-behavior: none;
  position: relative;
}*/

#spotlight-display,
#featured-display,
.as-spotlight-content,
.as-particles-container {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.as-featured-banner {
  padding: 4vh 4vw;
  box-sizing: border-box;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.as-particles-container {
    overflow: hidden;
    contain: strict;
    height: 100vh;
}

.as-heart-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 95; /* BELOW .as-spotlight-details (99999) and #vote-qr-code-container (100) */
    overflow: hidden;
}

.as-floating-heart {
    position: absolute;
    bottom: 0;
    color: #ff4d6d;
    opacity: 0;
    pointer-events: none;
    z-index: 1; /* Managed by parent */
    font-size: 32px;
    text-shadow: 
        0 0 25px rgba(255, 255, 255, 0.9), 
        0 0 35px rgba(255, 77, 109, 0.8),
        0 2px 8px rgba(0,0,0,0.6);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transform: translate(-50%, 0);
}
