:root {
    --primary: #ffd93d;
    --secondary: #4c96fe;
    --tertiary: #8ff199;
    --background: #fbf9f4;
    --text: #1b1c19;
    --card-shadow: rgba(76, 150, 254, 0.2);
}

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

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.hero-header {
    position: relative;
    background: linear-gradient(to bottom, #87CEEB, #E0F6FF);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 2rem;
}

.sky-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.sun {
    position: absolute;
    top: 10%; left: 10%;
    width: 120px; height: 120px;
    /* Use independent transform properties to avoid conflicts */
    animation: spin 20s linear infinite, sunBreathe 6s ease-in-out infinite;
}

@keyframes spin {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
}

@keyframes sunBreathe {
    0%, 100% { scale: 1; }
    50% { scale: 2; }
}

/* Sun Rays */
.sun-ray {
    position: absolute;
    top: calc(10% + 60px);
    left: calc(10% + 60px);
    height: 4px;
    background: #FFD700;
    border-radius: 4px;
    transform-origin: 0 50%;
    opacity: 0;
    animation: shootRay 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    z-index: 1;
    pointer-events: none;
}

@keyframes shootRay {
    0% { opacity: 0; transform: rotate(var(--angle)) translateX(50px); }
    20% { opacity: 1; transform: rotate(var(--angle)) translateX(70px); }
    100% { opacity: 0; transform: rotate(var(--angle)) translateX(140px); }
}

.cloud {
    position: absolute;
    width: 200px;
    height: 100px;
}

.cloud-1 { top: 15%; animation: floatCloud 30s linear infinite; }
.cloud-2 { top: 40%; animation: floatCloud 45s linear infinite; animation-delay: -15s; }
.cloud-3 { top: 60%; width: 250px; animation: floatCloud 35s linear infinite reverse; }
.cloud-4 { top: 25%; width: 150px; animation: floatCloud 38s linear infinite; animation-delay: -5s; }
.cloud-5 { top: 50%; width: 180px; animation: floatCloud 42s linear infinite reverse; animation-delay: -20s; }
.cloud-6 { top: 75%; width: 220px; animation: floatCloud 50s linear infinite; animation-delay: -10s; }

.stick-figure {
    position: absolute;
    width: 80px;
    height: 80px;
}
.stick-1 { bottom: 15%; left: 20%; animation: bounce 3s infinite ease-in-out; }
.stick-2 { bottom: 25%; right: 20%; animation: float 4s infinite ease-in-out; }

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

@keyframes floatCloud {
    0% { left: -250px; }
    100% { left: 110%; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

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

.header-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    margin-top: -10vh; /* Adjust for centering with wave */
}

.colorful-text {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-shadow: 
        -3px -3px 0 #1b1c19,
         0   -3px 0 #1b1c19,
         3px -3px 0 #1b1c19,
         3px  0   0 #1b1c19,
         3px  3px 0 #1b1c19,
         0    3px 0 #1b1c19,
        -3px  3px 0 #1b1c19,
        -3px  0   0 #1b1c19,
         6px  6px 0px rgba(0,0,0,0.2);
    opacity: 0;
}

body.unlocked .colorful-text {
    animation: popIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
}

.colorful-text-small {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 
        -2px -2px 0 #1b1c19,
         0   -2px 0 #1b1c19,
         2px -2px 0 #1b1c19,
         2px  0   0 #1b1c19,
         2px  2px 0 #1b1c19,
         0    2px 0 #1b1c19,
        -2px  2px 0 #1b1c19,
        -2px  0   0 #1b1c19,
         4px  4px 0px rgba(0,0,0,0.2);
    opacity: 0;
}

body.unlocked .colorful-text-small {
    animation: popIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.generation-box {
    background-color: rgba(255, 255, 255, 0.5);
    border: 4px dashed #ffe066;
    border-radius: 30px;
    padding: 1rem 3rem;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    opacity: 0;
}

body.unlocked .generation-box {
    animation: popIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.6s forwards;
}

.generation-text {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'Archivo Black', sans-serif;
    text-transform: uppercase;
    line-height: 1.1;
    
    /* Elegant Metallic Gold Gradient */
    background: linear-gradient(
        to bottom, 
        #d4af37 0%, 
        #fff0b3 30%, 
        #aa771c 50%, 
        #f8e594 70%, 
        #8a5a19 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    
    /* Elegant stroke */
    -webkit-text-stroke: 2px #3e2700;
    
    /* Elegant drop shadow */
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.4));
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(50px); }
    70% { opacity: 1; transform: scale(1.05) translateY(-10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes letterDance {
    0%, 100% { transform: scale(1) rotate(0deg) translateY(0); }
    25% { transform: scale(1.15) rotate(12deg) translateY(-15px); }
    50% { transform: scale(1) rotate(0deg) translateY(0); }
    75% { transform: scale(1.15) rotate(-12deg) translateY(-15px); }
}

.colorful-text span {
    display: inline-block;
    animation: letterDance 3s infinite ease-in-out;
}

@keyframes rainbowText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.wave-divider {
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
}

.wave-divider svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 150px;
}

/* Main Sections */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    text-align: center;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 4px dashed rgba(0,0,0,0.05);
}

.group-photo-section {
    background-color: #f0f8ff; /* Soft pastel blue */
    border-color: #b3d9ff;
}

.teacher-section {
    background-color: #fff9e6; /* Soft pastel yellow */
    border-color: #ffe066;
}

.motivational-section {
    background-color: #f2fceb; /* Soft pastel green */
    border-color: #bdecb6;
}

.gallery-section {
    background: linear-gradient(135deg, #ffcce6, #b3d9ff, #ffe066, #bdecb6, #d9b3ff);
    background-size: 400% 400%;
    animation: sectionGradient 6s ease infinite;
    border-color: #ff99cc;
}

@keyframes sectionGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.section-title {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10%;
    width: 80%;
    height: 6px;
    background-color: var(--primary);
    border-radius: 10px;
}

/* Group Photo */
.photo-frame {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px var(--card-shadow);
    display: inline-block;
    transform: rotate(1deg);
    transition: transform 0.3s;
}

.photo-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.hand-drawn-border {
    border: 4px dashed var(--primary);
}

.main-photo {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

/* Teacher */
.teacher-subtitle {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.teachers-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.teacher-frame {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.teacher-frame:hover {
    transform: scale(1.05);
}

.teacher-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
}

/* Motivational Section */
.motivational-section {
    padding: 2rem;
}

.motivational-card {
    background: linear-gradient(135deg, #FFE4E1, #FFDAB9);
    padding: 3rem 2rem;
    border-radius: 30px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    border: 3px dashed #fff;
}

.motivational-card::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 5rem;
    color: white;
    opacity: 0.5;
    font-family: serif;
}

.quote {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a4a4a;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.quote-author {
    display: block;
    font-size: 1.2rem;
    color: var(--secondary);
    font-weight: 700;
    text-align: right;
}

/* Gallery */
.gallery-section {
    background: linear-gradient(-45deg, #ffe4e1, #e0f6ff, #fff9e6, #e6ffe6);
    background-size: 400% 400%;
    animation: rainbowText 15s ease infinite;
    border-radius: 40px;
    margin: 2rem 1rem;
}

.gallery-grid {
    column-count: 4;
    column-gap: 1.5rem;
    padding: 1rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    display: inline-block;
    width: 100%;
    transform: translateZ(0); /* Forzar renderizado en iOS */
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 25px var(--card-shadow);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
}

.download-btn {
    margin-top: 20px;
    padding: 12px 30px;
    background-color: var(--primary);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.download-btn:hover {
    transform: scale(1.05);
}

/* Footer */
.site-footer {
    background-color: var(--primary);
    color: var(--text);
    text-align: center;
    padding: 4rem 2rem;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    margin-top: 2rem;
}

/* Password Overlay */
.password-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(251, 249, 244, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.password-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-overlay.fade-out .password-card {
    transform: scale(0.8);
    transition: transform 0.6s ease;
}

.password-card {
    background-color: #fff9e6;
    border: 4px dashed #ffe066;
    border-radius: 40px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.password-title {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.password-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 3px solid #ffe066;
    border-radius: 20px;
    margin: 1.5rem 0;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
}

.password-input:focus {
    outline: none;
    border-color: var(--secondary);
}

.privacy-checkbox-container {
    display: flex;
    align-items: flex-start;
    text-align: left;
    margin: 1rem 0 1.5rem 0;
    font-size: 0.9rem;
    color: var(--text);
}

.privacy-checkbox {
    margin-top: 5px;
    margin-right: 10px;
    transform: scale(1.3);
    cursor: pointer;
}

.privacy-checkbox-container label {
    cursor: pointer;
    line-height: 1.4;
}

.privacy-link {
    color: var(--secondary);
    font-weight: bold;
    text-decoration: underline;
}

.password-error {
    color: #ff6b6b;
    font-weight: 700;
    margin-top: 1rem;
    font-size: 1rem;
}

.site-footer p {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #25D366;
    color: white;
    padding: 15px 35px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
    transition: all 0.3s;
}

.whatsapp-btn:hover {
    background-color: #1ebe57;
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(37, 211, 102, 0.4);
}

.wa-icon {
    width: 24px;
    height: 24px;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .gallery-grid { column-count: 3; }
}

@media (max-width: 768px) {
    .colorful-text { font-size: 4rem; }
    .colorful-text-small { font-size: 2rem; }
    .generation-text { font-size: 1.8rem; margin-bottom: 1rem; }
    .section { padding: 3rem 1.5rem; }
    .section-title { font-size: 2rem; }
    .gallery-grid { column-count: 2; column-gap: 1rem; }
    .gallery-item { margin-bottom: 1rem; }
    .wave-divider svg { height: 80px; }
}

@media (max-width: 480px) {
    .gallery-grid { column-count: 1; }
}
