/* ========================================
   AI Photo Booth - Main Stylesheet
   ======================================== */

/* ========================================
   LAYOUT & STRUCTURAL STYLES
   ======================================== */

.grid-line {
    position: absolute;
    background: rgba(147, 51, 234, 0.2);
    pointer-events: none;
    z-index: 5;
}
.grid-line-h {
    width: 100%;
    height: 1px;
}
.grid-line-v {
    width: 1px;
    height: 100%;
}
video {
    transform: scaleX(-1);
}

/* ========================================
   ANIMATIONS & KEYFRAMES
   ======================================== */

@keyframes prominentPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}
@keyframes flash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
@keyframes flowRight {
    0% {
        transform: translateX(-8px);
        opacity: 0.3;
    }
    50% {
        transform: translateX(0);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
    100% {
        transform: translateX(8px);
        opacity: 0.3;
    }
}
@keyframes flowLeft {
    0% {
        transform: translateX(8px);
        opacity: 0.3;
    }
    50% {
        transform: translateX(0);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
    100% {
        transform: translateX(-8px);
        opacity: 0.3;
    }
}
@keyframes flowUp {
    0% {
        transform: translateY(8px);
        opacity: 0.3;
    }
    50% {
        transform: translateY(0);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
    100% {
        transform: translateY(-8px);
        opacity: 0.3;
    }
}
@keyframes flowDown {
    0% {
        transform: translateY(-8px);
        opacity: 0.3;
    }
    50% {
        transform: translateY(0);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
    100% {
        transform: translateY(8px);
        opacity: 0.3;
    }
}
@keyframes flowIn {
    0% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
    100% {
        transform: scale(1.2);
        opacity: 0.3;
    }
}
@keyframes flowOut {
    0% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    50% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

/* ========================================
   ANIMATION UTILITY CLASSES
   ======================================== */

.flowing-text {
    background: linear-gradient(90deg,
        rgba(250, 204, 21, 0.3) 0%,
        rgba(250, 204, 21, 1) 25%,
        rgba(250, 204, 21, 1) 50%,
        rgba(250, 204, 21, 1) 75%,
        rgba(250, 204, 21, 0.3) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: flowingLight 1.5s linear infinite;
}
.flowing-text-left {
    background: linear-gradient(90deg,
        rgba(250, 204, 21, 0.3) 0%,
        rgba(250, 204, 21, 1) 25%,
        rgba(250, 204, 21, 1) 50%,
        rgba(250, 204, 21, 1) 75%,
        rgba(250, 204, 21, 0.3) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: flowingLightLeft 1.5s linear infinite;
}
.flowing-text-right {
    background: linear-gradient(90deg,
        rgba(250, 204, 21, 0.3) 0%,
        rgba(250, 204, 21, 1) 25%,
        rgba(250, 204, 21, 1) 50%,
        rgba(250, 204, 21, 1) 75%,
        rgba(250, 204, 21, 0.3) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: flowingLightRight 1.5s linear infinite;
}
@keyframes flowingLight {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}
@keyframes flowingLightLeft {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}
@keyframes flowingLightRight {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}
@keyframes pulseArrow {
    0%, 100% {
        opacity: 0.4;
        filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 1));
    }
}
@keyframes rotateLeft {
    0%, 100% {
        transform: rotate(-10deg);
        opacity: 0.5;
    }
    50% {
        transform: rotate(10deg);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
}
@keyframes rotateRight {
    0%, 100% {
        transform: rotate(10deg);
        opacity: 0.5;
    }
    50% {
        transform: rotate(-10deg);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
    }
}
.arrow-flow-right {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(250, 204, 21, 0.3) 10%,
        rgba(250, 204, 21, 1) 30%,
        rgba(250, 204, 21, 1) 50%,
        rgba(250, 204, 21, 0.3) 70%,
        transparent 100%);
    background-size: 200% 100%;
    background-position: -100% 0;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14m-7-7l7 7-7 7' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14m-7-7l7 7-7 7' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center/contain no-repeat;
    animation: flowRightBackground 1.5s linear infinite;
}
@keyframes flowRightBackground {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}
.arrow-flow-left {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(250, 204, 21, 0.3) 10%,
        rgba(250, 204, 21, 1) 30%,
        rgba(250, 204, 21, 1) 50%,
        rgba(250, 204, 21, 0.3) 70%,
        transparent 100%);
    background-size: 200% 100%;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 12H5m7 7l-7-7 7-7' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 12H5m7 7l-7-7 7-7' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center/contain no-repeat;
    animation: flowLeftBackground 1.5s linear infinite;
}
@keyframes flowLeftBackground {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}
@keyframes slideDown {
    0% {
        transform: translateY(-100vh) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateY(10px) scale(0.95);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
.thumbnail-slide-in {
    animation: slideDown 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
/* Center-crop thumbnails in grid to prevent head cutoff */
.thumbnail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
    border-radius: 0.5rem;
}
.thumbnail-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%; /* Slightly above center to better frame faces */
}
@keyframes sparkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.8) rotate(0deg);
    }
    25% {
        opacity: 1;
        transform: scale(1.3) rotate(90deg);
    }
    50% {
        opacity: 0.7;
        transform: scale(1) rotate(180deg);
    }
    75% {
        opacity: 1;
        transform: scale(1.3) rotate(270deg);
    }
}
.animate-sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
    transform-origin: center;
    display: inline-block;
}
@keyframes fade-inout {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@keyframes fade-inout-reverse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}
.animate-fade-inout {
    animation: fade-inout 3s ease-in-out infinite;
}
.animate-fade-inout-reverse {
    animation: fade-inout-reverse 3s ease-in-out infinite;
}

/* Mobile-friendly modal styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 50;
    overflow-y: auto;
    padding: 0.5rem;
}
.modal-content {
    margin: 0.5rem auto;
    max-width: 100%;
}
