/* Hanging Menu Cards System - Based on existing slideouts mechanics */

/* About Picnic Hanging Card */
.about-hanging-trigger {
    position: fixed;
    left: 33vw; /* Global positioning for all screens */
    top: calc(8vw - 10vh); /* Same vertical positioning as other hanging cards */
    z-index: 0; /* Behind TV */
    pointer-events: none;
    opacity: 0; /* Hidden by default */
    transform: translateY(-100vh); /* Start above screen for drop-in */
    transition: opacity 0.3s ease, transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bounce effect */
}

.about-hanging-trigger.dropped {
    opacity: 1;
    transform: translateY(0);
}

.about-hanging-trigger.selected {
    filter: drop-shadow(0 0 10px rgba(236, 234, 1, 0.8));
}

/* Nail for About card */
.about-hanging-trigger::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1vw;
    height: 1vw;
    background: linear-gradient(to bottom, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%);
    border-radius: 50%;
    box-shadow: 0 0.2vw 0.4vw rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Chain for About card */
.about-hanging-trigger::after {
    content: "";
    position: absolute;
    top: 1vw;
    left: 50%;
    width: 0;
    height: 3vw; /* Changed from 5vh to proportional 3vw */
    border-left: 0.15vw dotted #444;
    transform-origin: 50% 0%;
    animation: about-chain-swing 2.2s infinite alternate ease-in-out;
    z-index: -1;
}

/* About hanging image */
.about-hanging-image {
    position: absolute;
    top: 4vw; /* Changed from 6vh to 4vw - below chain */
    left: 50%;
    transform: translateX(-50%);
    width: 10vw;
    height: calc(10vw * 1570/1024); /* Calculate height based on 1024/1570 aspect ratio */
    max-width: 10vw;
    max-height: calc(10vw * 1570/1024);
    object-fit: cover; /* Changed from contain to cover for proper fill */
    object-position: center;
    border: none;
    border-radius: 1vw; /* Rounded corners for the image */
    box-shadow: none;
    transform-origin: 50% -3vw; /* Changed from -5vh to -3vw for chain attachment */
    animation: about-image-swing 2.2s infinite alternate ease-in-out;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.3s ease;
    z-index: 0;
}

.about-hanging-image:hover {
    animation-play-state: paused;
    transform: translateX(-50%) scale(1.2);
}

.about-hanging-trigger:hover::after {
    animation-play-state: paused;
}

/* Credits Hanging Card */
.credits-hanging-trigger {
    position: fixed;
    left: 50vw; /* Global positioning for all screens */
    top: calc(8vw - 10vh);
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-100vh);
    transition: opacity 0.3s ease, transform 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.credits-hanging-trigger.dropped {
    opacity: 1;
    transform: translateY(0);
}

.credits-hanging-trigger.selected {
    filter: drop-shadow(0 0 10px rgba(236, 234, 1, 0.8));
}

/* Nail for Credits card */
.credits-hanging-trigger::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1vw;
    height: 1vw;
    background: linear-gradient(to bottom, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%);
    border-radius: 50%;
    box-shadow: 0 0.2vw 0.4vw rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Chain for Credits card */
.credits-hanging-trigger::after {
    content: "";
    position: absolute;
    top: 1vw;
    left: 50%;
    width: 0;
    height: 2.5vw; /* Changed from 4vh to proportional 2.5vw */
    border-left: 0.15vw dotted #444;
    transform-origin: 50% 0%;
    animation: credits-chain-swing 2.3s infinite alternate ease-in-out;
    z-index: -1;
}

/* Credits hanging image */
.credits-hanging-image {
    position: absolute;
    top: 3.5vw; /* Changed from 5vh to 3.5vw - below chain */
    left: 50%;
    transform: translateX(-50%);
    width: 10vw;
    height: calc(10vw * 1570/1024); /* Calculate height based on 1024/1570 aspect ratio */
    max-width: 10vw;
    max-height: calc(10vw * 1570/1024);
    object-fit: cover; /* Changed from contain to cover for proper fill */
    object-position: center;
    border: none;
    border-radius: 1vw; /* Rounded corners for the image */
    box-shadow: none;
    transform-origin: 50% -2.5vw; /* Changed from -4vh to -2.5vw for chain attachment */
    animation: credits-image-swing 2.3s infinite alternate ease-in-out;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.3s ease;
    z-index: 0;
}

.credits-hanging-image:hover {
    animation-play-state: paused;
    transform: translateX(-50%) scale(1.2);
}

.credits-hanging-trigger:hover::after {
    animation-play-state: paused;
}

/* Free Stuff Hanging Card */
.freestuff-hanging-trigger {
    position: fixed;
    left: 67vw; /* Global positioning for all screens */
    top: calc(8vw - 10vh);
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-100vh);
    transition: opacity 0.3s ease, transform 1.0s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.freestuff-hanging-trigger.dropped {
    opacity: 1;
    transform: translateY(0);
}

.freestuff-hanging-trigger.selected {
    filter: drop-shadow(0 0 10px rgba(236, 234, 1, 0.8));
}

/* Nail for Free Stuff card */
.freestuff-hanging-trigger::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1vw;
    height: 1vw;
    background: linear-gradient(to bottom, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%);
    border-radius: 50%;
    box-shadow: 0 0.2vw 0.4vw rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Chain for Free Stuff card */
.freestuff-hanging-trigger::after {
    content: "";
    position: absolute;
    top: 1vw;
    left: 50%;
    width: 0;
    height: 3.5vw; /* Changed from 6vh to proportional 3.5vw */
    border-left: 0.15vw dotted #444;
    transform-origin: 50% 0%;
    animation: freestuff-chain-swing 2.4s infinite alternate ease-in-out;
    z-index: -1;
}

/* Free Stuff hanging image container */
.freestuff-hanging-image {
    position: absolute;
    top: 4.5vw; /* Changed from 7vh to 4.5vw - below chain */
    left: 50%;
    transform: translateX(-50%);
    width: 10vw; /* Fixed width for container */
    height: calc(10vw * 1570/1024); /* Calculate height based on 1024/1570 aspect ratio */
    max-width: 10vw;
    max-height: calc(10vw * 1570/1024);
    border: none;
    border-radius: 1vw;
    box-shadow: none;
    transform-origin: 50% -3.5vw; /* Changed from -6vh to -3.5vw for chain attachment */
    animation: freestuff-image-swing 2.4s infinite alternate ease-in-out;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.3s ease;
    z-index: 0;
    overflow: hidden; /* Ensure contents don't exceed container */
}

.freestuff-hanging-image:hover {
    animation-play-state: paused;
    transform: translateX(-50%) scale(1.2);
}

.freestuff-hanging-trigger:hover::after {
    animation-play-state: paused;
}

/* Legacy class removed - using consolidated .hanging-bg-image from slideouts.css */

/* Text overlay positioned over the background image */
.freestuff-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Fill entire container */
    height: 100%; /* Fill entire container */
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1vw;
    text-align: center;
    color: black;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 1vw; /* Larger text for hanging card */
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none; /* Let clicks pass through to container */
    z-index: 1; /* Above background image */
    /* No animation - inherits movement from parent container */
}

/* Disable links in hanging card - not clickable */
.freestuff-overlay a {
    pointer-events: none;
}

.freestuff-overlay h3 {
    color: black;
    font-weight: bold;
    margin-bottom: 1vw;
    font-size: 1.6vw;
}

.freestuff-overlay a {
    color: black;
    text-decoration: underline;
    display: block;
    margin-bottom: 0.4vw;
}

.freestuff-overlay a:hover {
    color: #333;
}

/* Free Stuff Section Spacing - Extracted from inline styles */
.freestuff-section-spacing {
    margin-top: 1vw;
}

/* Chain vertical states when cards are enlarged */
.about-hanging-trigger.chain-vertical::after {
    animation: none;
    transform: translateX(-50%) rotate(var(--chain-rotation, 0deg));
}

.credits-hanging-trigger.chain-vertical::after {
    animation: none;
    transform: translateX(-50%) rotate(var(--chain-rotation, 0deg));
}

.freestuff-hanging-trigger.chain-vertical::after {
    animation: none;
    transform: translateX(-50%) rotate(var(--chain-rotation, 0deg));
}

.freestuff-hanging-trigger.chain-vertical .freestuff-overlay {
    animation: none;
    transform: translateX(-50%) rotate(var(--chain-rotation, 0deg));
}

/* Swing animations */
@keyframes about-chain-swing {
    0% { transform: translateX(-50%) rotate(-11deg) }
    100% { transform: translateX(-50%) rotate(11deg) }
}

@keyframes about-image-swing {
    0% { transform: translateX(-50%) rotate(-11deg) }
    100% { transform: translateX(-50%) rotate(11deg) }
}

@keyframes credits-chain-swing {
    0% { transform: translateX(-50%) rotate(-12deg) }
    100% { transform: translateX(-50%) rotate(12deg) }
}

@keyframes credits-image-swing {
    0% { transform: translateX(-50%) rotate(-12deg) }
    100% { transform: translateX(-50%) rotate(12deg) }
}

@keyframes freestuff-chain-swing {
    0% { transform: translateX(-50%) rotate(-13deg) }
    100% { transform: translateX(-50%) rotate(13deg) }
}

@keyframes freestuff-image-swing {
    0% { transform: translateX(-50%) rotate(-13deg) }
    100% { transform: translateX(-50%) rotate(13deg) }
}

/* freestuff-overlay-swing animation removed - overlay now inherits movement from parent image */

@keyframes freestuff-content-swing {
    0% { transform: translateX(-50%) rotate(-13deg) }
    100% { transform: translateX(-50%) rotate(13deg) }
}

/* Free Stuff content overlay that starts hanging and enlarges */
.freestuff-content-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: min(40vw, calc(80vh * 1016 / 1530));
    height: calc(min(40vw, calc(80vh * 1016 / 1530)) * 1530 / 1016);
    min-width: clamp(25vw, 30vw, 35vw);
    min-height: calc(clamp(25vw, 30vw, 35vw) * 1530 / 1016);
    max-width: clamp(40vw, 50vw, 60vw);
    max-height: calc(clamp(40vw, 50vw, 60vw) * 1530 / 1016);
    border-radius: clamp(10px, 2vw, 20px);
    background-image: url('../images/slide-outs/free-stuff.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    /* No animation - only visible when enlarged */
}

/* When Free Stuff enlarges to center */
.freestuff-content-overlay.active {
    position: fixed;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    background-size: cover;
    background-position: center;
    border-radius: clamp(10px, 2vw, 20px);
    box-shadow: 0 clamp(10px, 2vw, 20px) clamp(40px, 6vw, 80px) rgba(0, 0, 0, 0.8);
    z-index: 9999;
    animation: none; /* Stop swinging when enlarged */
    opacity: 1;
}

/* Chain vertical state stops swinging */
.freestuff-hanging-trigger.chain-vertical .freestuff-content-overlay {
    animation: none;
    transform: translateX(-50%) rotate(var(--chain-rotation, 0deg));
}

/* ORPHANED CLASS - Removed unused freestuff-form-overlay */
/*
.freestuff-form-overlay .freestuff-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: clamp(10px, 2vw, 20px);
}
*/

.freestuff-content {
    position: absolute;
    top: 55%; /* Move down slightly from center */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%; /* Make wider to fit better */
    color: black;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.5vw; /* Small in hanging state */
    line-height: 1.1;
    text-align: center;
    pointer-events: none; /* Let clicks pass through to image in hanging state */
    z-index: 1;
}

/* Small text in hanging state */
.freestuff-content h3 {
    color: black;
    font-weight: bold;
    margin-bottom: 0.2vw;
    font-size: 0.8vw; /* Small headings when hanging */
}

/* Larger text when enlarged */
.freestuff-content-overlay.active .freestuff-content {
    font-size: clamp(1.5rem, 2vw, 3rem);
    line-height: 1.2;
    pointer-events: auto; /* Enable clicks when enlarged */
}

.freestuff-content-overlay.active .freestuff-content h3 {
    font-size: clamp(2rem, 3.5vw, 4rem);
    margin-bottom: 1.5rem;
}

.freestuff-content a {
    color: black;
    text-decoration: underline;
    display: block;
    margin-bottom: 1rem;
}

.freestuff-content a:hover {
    color: #333;
}

/* Easter Egg overlay - same format as hanging card overlay */
.easter-egg-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: min(40vw, calc(80vh * 1016 / 1530));
    height: calc(min(40vw, calc(80vh * 1016 / 1530)) * 1530 / 1016);
    min-width: clamp(25vw, 30vw, 35vw);
    min-height: calc(clamp(25vw, 30vw, 35vw) * 1530 / 1016);
    max-width: clamp(40vw, 50vw, 60vw);
    max-height: calc(clamp(40vw, 50vw, 60vw) * 1530 / 1016);
    background: rgba(0, 0, 0, 0.9);
    border-radius: clamp(10px, 2vw, 20px);
    box-shadow: 0 clamp(10px, 2vw, 20px) clamp(40px, 6vw, 80px) rgba(0, 0, 0, 0.8);
    z-index: 10000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.easter-egg-overlay.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.easter-egg-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: clamp(10px, 2vw, 20px);
}

/* Celebration confetti effect */
.celebration-confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ECEA01;
    position: fixed;
    animation: confetti-fall 3s ease-in forwards;
    z-index: 9998;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-5vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(120vh) rotate(720deg);
        opacity: 0;
    }
}

/* Card enlargement overlay - simplified for About and Credits only */
.hanging-card-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: min(40vw, calc(80vh * 1016 / 1530));
    height: calc(min(40vw, calc(80vh * 1016 / 1530)) * 1530 / 1016);
    min-width: clamp(25vw, 30vw, 35vw);
    min-height: calc(clamp(25vw, 30vw, 35vw) * 1530 / 1016);
    max-width: clamp(40vw, 50vw, 60vw);
    max-height: calc(clamp(40vw, 50vw, 60vw) * 1530 / 1016);
    background: rgba(0, 0, 0, 0.9);
    border-radius: clamp(10px, 2vw, 20px);
    box-shadow: 0 clamp(10px, 2vw, 20px) clamp(40px, 6vw, 80px) rgba(0, 0, 0, 0.8);
    z-index: 9999;
    transition: transform 0.3s ease;
    opacity: 0;
}

.hanging-card-overlay.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.hanging-card-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: clamp(10px, 2vw, 20px);
}
