* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* createIT Brand Colors */
    --createit-orange: #FF8030;
    --createit-black: #222222;
    --createit-gray: #4C4C4C;
    --createit-light: #F9F9F9;

    /* Christmas Colors */
    --christmas-red: #D4463C;
    --christmas-green: #5A8770;
    --gold: #D4AF37;
    --cream: #FFF8DC;
    --white: #FFFFFF;

    /* Clay 3D Shadows */
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-deep: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--createit-light) 0%, var(--white) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}

/* Christmas Decorations */
.decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Snowflakes - Clay Style */
.snowflake {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(220,240,255,0.8) 100%);
    border-radius: 50%;
    opacity: 0.6;
    animation: snowfall linear infinite;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.snowflake::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.snowflake:nth-child(1) { left: 5%; animation-duration: 12s; animation-delay: 0s; width: 25px; height: 25px; }
.snowflake:nth-child(2) { left: 15%; animation-duration: 15s; animation-delay: 2s; width: 20px; height: 20px; }
.snowflake:nth-child(3) { left: 25%; animation-duration: 10s; animation-delay: 4s; width: 30px; height: 30px; }
.snowflake:nth-child(4) { left: 35%; animation-duration: 13s; animation-delay: 1s; width: 22px; height: 22px; }
.snowflake:nth-child(5) { left: 65%; animation-duration: 14s; animation-delay: 3s; width: 28px; height: 28px; }
.snowflake:nth-child(6) { left: 75%; animation-duration: 11s; animation-delay: 5s; width: 24px; height: 24px; }
.snowflake:nth-child(7) { left: 85%; animation-duration: 16s; animation-delay: 2.5s; width: 26px; height: 26px; }
.snowflake:nth-child(8) { left: 95%; animation-duration: 12s; animation-delay: 4.5s; width: 23px; height: 23px; }

@keyframes snowfall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
    }
}

/* Golden Stars Decoration */
.star-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--gold) 0%, #C19B2F 100%);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0.4;
    animation: floatStar 6s ease-in-out infinite;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.star-decoration:nth-child(odd) { animation-delay: 0s; }
.star-decoration:nth-child(even) { animation-delay: 3s; }

@keyframes floatStar {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

/* Header */
.header {
    text-align: center;
    color: var(--createit-black);
    margin-bottom: 60px;
    animation: fadeInDown 1s ease-out 0.2s;
    animation-fill-mode: both;
}

.header h1 {
    font-family: 'Open Sans', sans-serif;
    font-size: 3.5em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--createit-black);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header h2 {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.4em;
    font-weight: 400;
    color: var(--createit-gray);
    line-height: 1.6;
}

/* Gift Boxes Section */
.boxes-section {
    animation: fadeIn 1s ease-out 0.4s;
    animation-fill-mode: both;
}

.boxes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 50px;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Clay 3D Gift Box */
.gift-box {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fadeInUp 1s ease-out;
    animation-fill-mode: both;
    position: relative;
}

.gift-box:nth-child(1) { animation-delay: 0.6s; }
.gift-box:nth-child(2) { animation-delay: 0.8s; }
.gift-box:nth-child(3) { animation-delay: 1s; }

.gift-box:hover {
    transform: translateY(-15px) scale(1.05);
}

.gift-box:active {
    transform: translateY(-10px) scale(1.02);
}

.gift-box.fade-out {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
    pointer-events: none;
}

.gift-box.selected {
    transform: scale(1.15) translateY(-20px) !important;
    z-index: 100;
}

.gift-box.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* Box Inner Container */
.box-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Box Image - Will be replaced with AI generated clay 3D images */
.box-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(var(--shadow-medium));
    transition: filter 0.3s ease;
}

.gift-box:hover .box-image {
    filter: drop-shadow(var(--shadow-deep));
}

/* Christmas Icons - createIT Phosphor Style */
.christmas-icon {
    position: absolute;
    font-size: 2.5em;
    opacity: 0.15;
    animation: floatIcon 8s ease-in-out infinite;
    filter: grayscale(20%);
    color: var(--createit-orange);
    text-shadow: 0 2px 8px rgba(255, 128, 48, 0.3);
    pointer-events: none;
}

.christmas-icon:nth-child(odd) {
    animation-duration: 10s;
    animation-delay: 0s;
}

.christmas-icon:nth-child(even) {
    animation-duration: 12s;
    animation-delay: 2s;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
        opacity: 0.25;
    }
}

/* CSS 3D Gift Box Fallback (if AI images not loaded) */
.box-3d-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
}

.box-3d-container {
    position: relative;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.gift-box:hover .box-3d-container {
    transform: rotateY(10deg) rotateX(-5deg) translateY(-10px);
}

.gift-box.selected .box-3d-container {
    transform: rotateY(15deg) rotateX(-10deg) scale(1.2);
}

/* Box Lid - Top Part */
.box-lid {
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 40px;
    background: linear-gradient(135deg, var(--christmas-red) 0%, #B8382E 100%);
    border-radius: 12px 12px 0 0;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 -2px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 8px rgba(255, 255, 255, 0.2);
    transform-origin: bottom;
    transition: transform 0.6s ease;
    z-index: 10;
}

.gift-box:hover .box-lid {
    transform: rotateX(-15deg) translateY(-5px);
}

.gift-box.selected .box-lid {
    transform: rotateX(-90deg) translateY(-40px);
    opacity: 0.5;
}

/* Bow on Lid */
.box-lid::before,
.box-lid::after {
    content: '';
    position: absolute;
    top: -15px;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, var(--gold) 0%, #C19B2F 100%);
    border-radius: 50% 0 50% 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.box-lid::before {
    left: 30%;
    transform: rotate(45deg);
}

.box-lid::after {
    right: 30%;
    transform: rotate(-135deg);
}

/* Box Base - Main Body */
.box-base {
    position: absolute;
    top: 35px;
    left: 0;
    width: 100%;
    height: 165px;
    background: linear-gradient(135deg, var(--christmas-red) 0%, #B8382E 100%);
    border-radius: 12px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 -6px 16px rgba(0, 0, 0, 0.2),
        inset 0 6px 16px rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: visible;
}

/* Green Box */
.box-3d-fallback[data-color="green"] .box-lid,
.box-3d-fallback[data-color="green"] .box-base {
    background: linear-gradient(135deg, var(--christmas-green) 0%, #4A6F5E 100%);
}

/* Orange Box */
.box-3d-fallback[data-color="orange"] .box-lid,
.box-3d-fallback[data-color="orange"] .box-base {
    background: linear-gradient(135deg, var(--createit-orange) 0%, #E6721C 100%);
}

/* Ribbons */
.ribbon-vertical {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: calc(100% + 10px);
    background: linear-gradient(90deg, var(--gold) 0%, #D4AF37 50%, #C19B2F 100%);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 0 8px rgba(255, 255, 255, 0.3);
    z-index: 5;
}

.ribbon-horizontal {
    position: absolute;
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    width: calc(100% + 10px);
    height: 25px;
    background: linear-gradient(180deg, var(--gold) 0%, #D4AF37 50%, #C19B2F 100%);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 0 8px rgba(255, 255, 255, 0.3);
    z-index: 4;
}

/* Star Tag with Number */
.star-tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--cream) 0%, #F5E6D3 100%);
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%,
        79% 91%, 50% 70%, 21% 91%, 32% 57%,
        2% 35%, 39% 35%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--createit-black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 6;
}

/* Small Decorative Stars on Box */
.box-base::before,
.box-base::after {
    content: '⭐';
    position: absolute;
    font-size: 0.8em;
    opacity: 0.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.box-base::before {
    top: 20%;
    left: 15%;
}

.box-base::after {
    bottom: 25%;
    right: 18%;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    color: var(--createit-gray);
    animation: fadeIn 0.3s ease-out;
    margin-top: 40px;
}

.spinner {
    border: 4px solid rgba(255, 128, 48, 0.2);
    border-top: 4px solid var(--createit-orange);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-soft);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.2em;
    font-weight: 600;
}

/* Thank You Page - Clay Style */
.thank-you-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--createit-light) 0%, var(--white) 100%);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
    padding: 20px;
}

.thank-you-page.active {
    display: flex;
}

.thank-you-content {
    text-align: center;
    color: var(--createit-black);
    max-width: 800px;
    width: 100%;
    padding: 60px 40px;
    position: relative;
    animation: bounceIn 0.8s ease-out;
    background: var(--white);
    border-radius: 30px;
    box-shadow: var(--shadow-deep);
}

.wwf-logo-container {
    margin-bottom: 40px;
}

.wwf-logo {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(var(--shadow-soft));
}

/* Animal Result - Clay 3D Image */
.animal-result {
    margin: 40px 0;
    animation: bounceIn 1s ease-out;
}

.animal-result img {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(var(--shadow-medium));
}

.animal-result .animal-emoji {
    font-size: 10em;
    animation: bounceIn 1s ease-out;
    filter: drop-shadow(var(--shadow-soft));
}

/* Thank You Text */
.thank-you-text {
    font-size: 1.8em;
    line-height: 1.6;
    margin: 40px 0;
    color: var(--createit-gray);
    font-weight: 400;
}

.thank-you-text .highlight {
    color: var(--createit-orange);
    font-weight: 700;
}

.thank-you-text p {
    margin: 15px 0;
}

/* createIT Footer Logo */
.createit-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--createit-light);
}

.footer-logo {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(var(--shadow-soft));
}

/* Error Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(34, 34, 34, 0.85);
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 25px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: scaleIn 0.4s ease-out;
    box-shadow: var(--shadow-deep);
    border: 3px solid var(--createit-orange);
}

.modal-content.error {
    border-color: var(--christmas-red);
}

.modal-content h2 {
    color: var(--createit-black);
    font-size: 2.2em;
    margin-bottom: 20px;
    font-weight: 700;
}

.error-content {
    font-size: 1.2em;
    color: var(--createit-gray);
    margin: 30px 0;
    line-height: 1.6;
}

.btn-close {
    background: linear-gradient(135deg, var(--createit-orange) 0%, #E6721C 100%);
    color: var(--white);
    padding: 15px 50px;
    font-size: 1.1em;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.btn-close:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-deep);
}

.btn-close:active {
    transform: translateY(0);
}

/* Confetti Animation */
.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti::before,
.confetti::after {
    content: '✨';
    position: absolute;
    font-size: 3em;
    animation: confettiFall 3s ease-out infinite;
}

.confetti::before {
    left: 20%;
    animation-delay: 0s;
}

.confetti::after {
    left: 80%;
    animation-delay: 1.5s;
}

@keyframes confettiFall {
    0% {
        top: -50px;
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
    100% {
        top: 100%;
        opacity: 0;
        transform: rotate(720deg) scale(0.5);
    }
}

/* Core Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        max-width: 200px;
    }

    .header h1 {
        font-size: 2.2em;
    }

    .header h2 {
        font-size: 1.1em;
    }

    .boxes-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .thank-you-content {
        padding: 40px 25px;
    }

    .thank-you-text {
        font-size: 1.4em;
    }

    .animal-result img {
        max-width: 220px;
    }

    .animal-result .animal-emoji {
        font-size: 6em;
    }

    .wwf-logo {
        max-width: 120px;
    }

    .footer-logo {
        max-width: 160px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }

    .logo {
        max-width: 180px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .header h2 {
        font-size: 1em;
    }

    .boxes-container {
        gap: 30px;
    }

    .thank-you-text {
        font-size: 1.2em;
    }

    .animal-result img {
        max-width: 180px;
    }

    .animal-result .animal-emoji {
        font-size: 5em;
    }

    .modal-content {
        padding: 35px 25px;
    }

    .modal-content h2 {
        font-size: 1.8em;
    }
}
