/* Modern Photobooth CSS - Enhanced Design */

:root {
    /* Modern gradient color system */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gold-gradient: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    --cyber-gradient: linear-gradient(135deg, #0f3460 0%, #e94560 50%, #f16529 100%);
    
    /* Glass morphism */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-bg-strong: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.2);
    --dark-glass: rgba(0, 0, 0, 0.3);
    
    /* Colors */
    --primary-color: #667eea;
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --accent-color: #f093fb;
    --white: #ffffff;
    
    /* Shadows & Effects */
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.4);
    --shadow-pink-glow: 0 0 30px rgba(240, 147, 251, 0.4);
}

/* Base styles */
html, body {
    overflow: hidden;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Kreon', serif;
}

/* Animated background */
body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: var(--cyber-gradient);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    background-attachment: fixed;
    text-align: center;
    gap: min(5vh, 60px);
    padding: 5vh 5vw;
    box-sizing: border-box;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animated particles overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 200px 200px;
    animation: particleFloat 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes particleFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

/* Page specific backgrounds with glass overlay */
body.home::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('img/image-bg.png') center/cover no-repeat;
    opacity: 0.3;
    z-index: 2;
}

body.instructions::after,
body.photobooth::after,
body.download::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('img/image-bg-1.png') center/cover no-repeat;
    opacity: 0.3;
    z-index: 2;
}

/* All content above overlay */
body > * {
    position: relative;
    z-index: 10;
}

/* Logo styles */
.logo1 {
    margin-top: 10vh;
    font-family: 'Koulen', sans-serif;
    font-size: clamp(3rem, 8vw, 5rem);
    text-align: center;
    color: var(--text-color);
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(102, 126, 234, 0.3);
    animation: logoGlow 3s ease-in-out infinite alternate;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #ffffff, #667eea, #f093fb, #ffffff);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGlow 3s ease-in-out infinite alternate, textShimmer 4s ease-in-out infinite;
}

@keyframes logoGlow {
    0% { filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.3)); }
    100% { filter: drop-shadow(0 0 30px rgba(240, 147, 251, 0.5)); }
}

@keyframes textShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo2 {
    padding-left: 2em;
    font-family: 'Koulen', sans-serif;
    font-size: 24px;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    color: var(--text-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

/* Enhanced image styling */
img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(var(--shadow-soft));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

img:hover {
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(var(--shadow-glow));
}

.star {
    margin-top: -70px;
    animation: starRotate 6s linear infinite, starFloat 3s ease-in-out infinite alternate;
}

@keyframes starRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes starFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(360deg); }
}

/* Modern button design */
button {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-family: 'Kreon', serif;
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 600;
    background: var(--secondary-gradient);
    padding: 1.2rem 2.5rem;
    gap: 8px;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Button shimmer effect */
button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-pink-glow);
    background: var(--accent-gradient);
}

button:active {
    transform: translateY(-2px) scale(1.02);
    transition: all 0.1s ease;
}

/* Fixed positioning */
#ready-btn, #start-btn {
    position: fixed;
    bottom: calc(56px + 56px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

/* Link styles */
a {
    text-decoration: none;
}

/* Enhanced footer */
.footer-text {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'League Spartan', sans-serif;
    font-size: clamp(12px, 1.5vw, 16px);
    font-weight: 500;
    text-align: center;
    max-width: 90%;
    color: var(--text-secondary);
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

/* PHOTOBOOTH STYLES */
.photobooth {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.camera-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 90%;
    max-width: 960px;
    padding: 2rem;
    height: 100vh;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-strong);
}

video {
    width: 100%;
    max-width: 600px;
    height: auto;
    aspect-ratio: 4/3;
    border: 8px solid var(--white);
    background-color: var(--white);
    border-radius: 20px;
    transform: scaleX(-1);
    box-shadow: var(--shadow-strong);
    transition: all 0.3s ease;
}

video:hover {
    transform: scaleX(-1) scale(1.02);
    box-shadow: var(--shadow-glow);
}

/* Countdown styling */
#countdown {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: bold;
    color: var(--text-color);
    text-align: center;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(15px);
    padding: 1rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

#counter {
    font-size: clamp(48px, 8vw, 72px);
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 
        0 0 20px rgba(240, 147, 251, 0.8),
        0 4px 15px rgba(0, 0, 0, 0.5);
    animation: counterPulse 1s ease-in-out infinite;
}

@keyframes counterPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* DOWNLOAD PAGE STYLES */
body.download {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    flex-direction: column;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 30px;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-strong);
    max-width: 90vw;
}

#finalCanvas {
    max-width: 50vw;
    max-height: 60vh;
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
}

.right {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    min-width: 300px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
}

.color-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.color-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.color-btn:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-glow);
}

.color-btn:hover::after {
    opacity: 1;
}

.button-last {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.button-last button {
    padding: 1rem 2rem;
    font-size: 16px;
    border: none;
    color: white;
    min-width: 120px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .logo1 {
        font-size: clamp(2.5rem, 8vw, 4rem);
        margin-top: 5vh;
    }

    body {
        gap: min(3vh, 40px);
    }

    img {
        max-width: 300px;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    button {
        font-size: 18px;
        padding: 1rem 2rem;
    }

    .footer-text {
        bottom: 10px;
        font-size: 12px;
        padding: 0.6rem 1.2rem;
    }

    .main-container {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }

    .right {
        margin-left: 0;
        min-width: auto;
        width: 100%;
    }

    #finalCanvas {
        max-width: 80vw;
        max-height: 50vh;
    }

    .camera-container {
        max-width: 95%;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    video {
        border-width: 6px;
    }

    .color-btn {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .logo1 {
        font-size: clamp(2rem, 10vw, 3rem);
        margin-bottom: 2rem;
    }

    img {
        max-width: 250px;
        margin-bottom: 2rem;
    }

    button {
        font-size: 16px;
        padding: 0.9rem 1.8rem;
        margin-top: 2rem;
    }

    .main-container {
        gap: 1.5rem;
        padding: 1rem;
        margin-bottom: 0;
    }

    .footer-text {
        font-size: 10px;
        padding: 0.5rem 1rem;
    }

    .color-btn {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }

    .camera-container {
        padding: 1rem;
        gap: 1rem;
    }

    video {
        border-width: 4px;
        border-radius: 15px;
    }

    #countdown {
        font-size: 18px;
        padding: 0.8rem 1.5rem;
    }

    #counter {
        font-size: clamp(36px, 12vw, 48px);
    }

    .right {
        padding: 1.5rem;
    }

    .button-last {
        flex-direction: column;
        gap: 0.8rem;
    }

    .button-last button {
        width: 100%;
        min-width: auto;
    }
}
