:root {
    --primary-color: #ffe4e1; /* Misty Rose */
    --secondary-color: #ffb7b2; /* Melon */
    --accent-color: #9e7777; /* Taupe */
    --text-color: #4a4a4a;
    --bg-color: #fafafa;
    --white: #ffffff;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] {
    --primary-color: #2d2b55;
    --secondary-color: #a29bfe;
    --accent-color: #81ecec;
    --text-color: #dfe6e9;
    --bg-color: #1e1e2e;
    --white: #ffffff;
    --card-bg: #2d3436;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: "Nunito", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3 {
    font-family: "Fredoka", sans-serif;
    font-weight: 600;
}

/* Sakura Decoration - Large & Fixed */
.sakura-decoration {
    position: fixed;
    top: -50px;
    right: -50px;
    width: 500px; /* Tamaño grande para decorar bien la esquina */
    height: auto;
    z-index: 0; /* Detrás del header si se superpone, o usar pointer-events: none */
    opacity: 0.85;
    pointer-events: none; /* Click through */
    filter: drop-shadow(0 0 15px rgba(255, 192, 203, 0.4));
}

/* Header Section */
.main-header {
    text-align: center;
    padding: 4rem 1rem 2rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--white);
    box-shadow: 0 8px 20px rgba(230, 164, 180, 0.3);
}

.main-header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 0;
}

.subtitle {
    font-size: 1.1rem;
    color: #888;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    background-color: var(--primary-color);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    display: inline-block;
}

/* Gallery Grid - Full Width Responsive */
.gallery-grid {
    display: grid;
    /* Ajuste automático: mínimo 350px de ancho por columna */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 2rem 4%;
    max-width: 1800px; /* Limite muy amplio para pantallas grandes */
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.gallery-item {
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    box-shadow: 0 10px 25px var(--shadow-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.8s ease-out backwards;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Staggered Animation for Grid Items */
.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}
.gallery-item:nth-child(2) {
    animation-delay: 0.15s;
}
.gallery-item:nth-child(3) {
    animation-delay: 0.2s;
}
.gallery-item:nth-child(4) {
    animation-delay: 0.25s;
}
.gallery-item:nth-child(5) {
    animation-delay: 0.3s;
}
.gallery-item:nth-child(6) {
    animation-delay: 0.35s;
}
.gallery-item:nth-child(7) {
    animation-delay: 0.4s;
}
.gallery-item:nth-child(8) {
    animation-delay: 0.45s;
}
.gallery-item:nth-child(9) {
    animation-delay: 0.5s;
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px var(--secondary-color);
}

/* Placeholder Styling for Minecraft look */
.image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    font-family: "Fredoka", sans-serif;

    /* Patrón de cuadrícula sutil */
    background-image:
        linear-gradient(
            45deg,
            #fff 25%,
            transparent 25%,
            transparent 75%,
            #fff 75%,
            #fff
        ),
        linear-gradient(
            45deg,
            #fff 25%,
            transparent 25%,
            transparent 75%,
            #fff 75%,
            #fff
        );
    background-color: var(--primary-color);
    background-size: 30px 30px;
    background-position:
        0 0,
        15px 15px;
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0 2rem;
    color: #aaa;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sakura-decoration {
        width: 300px;
        top: -30px;
        right: -80px;
    }

    .main-header h1 {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr; /* Una columna en móvil */
        padding: 1rem;
        gap: 2rem;
    }

    .gallery-item {
        border-radius: 15px;
    }
}

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

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

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

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: var(--white);
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    line-height: 1;
    transition: transform 0.2s;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
}

/* --- Parallax Clouds --- */
.cloud-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.pixel-cloud {
    position: absolute;
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.c1 {
    width: 200px;
    height: 100px;
    top: 15%;
    left: -200px;
    background-image: url("https://art.pixilart.com/005e04279093b82.png");
    animation: floatCloud 60s linear infinite;
    opacity: 0.9;
}

.c2 {
    width: 180px;
    height: 90px;
    top: 35%;
    left: -180px;
    background-image: url("https://art.pixilart.com/005e04279093b82.png");
    animation: floatCloud 80s linear infinite;
    animation-delay: -25s;
    opacity: 0.7;
    transform: scaleX(-1); /* Flip horizontal for variety */
}

.c3 {
    width: 250px;
    height: 125px;
    top: 60%;
    left: -250px;
    background-image: url("https://art.pixilart.com/005e04279093b82.png");
    animation: floatCloud 50s linear infinite;
    animation-delay: -10s;
    opacity: 0.8;
}

.c4 {
    width: 150px;
    height: 75px;
    top: 85%;
    left: -150px;
    background-image: url("https://art.pixilart.com/005e04279093b82.png");
    animation: floatCloud 70s linear infinite;
    animation-delay: -40s;
    opacity: 0.6;
    transform: scale(0.8);
}

@keyframes floatCloud {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(100vw + 300px));
    }
}

[data-theme="dark"] .pixel-cloud {
    filter: brightness(0.7) opacity(0.5)
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

/* --- New Features --- */

/* 1. Theme Toggle (Sun/Moon) */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 0 20px var(--secondary-color);
}

/* 2. Magic Cursor Particles */
.cursor-particle {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: particleFade 1s forwards;
    box-shadow: 0 0 5px var(--secondary-color);
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* 3. Music Widget (Glassmorphism) */
.music-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 900;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    transition: all 0.3s ease;
    max-width: 300px;
}

.music-widget:hover {
    transform: translateY(-5px);
    background: var(--card-bg);
}

.music-icon {
    font-size: 1.5rem;
    animation: spin 4s linear infinite;
    animation-play-state: paused;
}

.music-widget.playing .music-icon {
    animation-play-state: running;
}

.music-info {
    display: flex;
    flex-direction: column;
}

.song-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color);
}

.artist-name {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.8;
}

.play-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.2s;
}

.play-btn:hover {
    transform: scale(1.2);
    color: var(--secondary-color);
}

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

/* --- Integrated 3D Carousel (Smooth Frame) --- */
.featured-section {
    padding: 2rem 0 4rem !important;
    position: relative;
    margin-bottom: 2rem;
}

.carousel-scene {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 10px 40px -5px var(--shadow-color) !important;
    backdrop-filter: blur(15px) !important;
    overflow: hidden !important;
    height: 480px !important;
    border-radius: 40px !important;
    margin-top: 2rem !important;
    width: 95% !important;
    max-width: 1200px !important;
}

.carousel-card {
    border: 4px solid var(--white) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
    -webkit-box-reflect: below 5px
        linear-gradient(transparent, transparent 65%, rgba(255, 255, 255, 0.2));
}

.carousel-controls {
    position: absolute !important;
    top: 55% !important;
    left: 0 !important;
    width: 100% !important;
    transform: translateY(-50%) !important;
    justify-content: space-between !important;
    padding: 0 40px !important;
    margin-top: 0 !important;
    pointer-events: none;
    z-index: 100;
}

.nav-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(5px);
    width: 60px !important;
    height: 60px !important;
    border: none !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
}

.nav-btn:hover {
    background: var(--white) !important;
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--secondary-color) !important;
    color: var(--secondary-color) !important;
}
