/* Optimized Main CSS - Performance Focused */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Pixelify Sans', cursive, sans-serif;
    background: #FFF8FB;
    color: #4B305F;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    background-image: radial-gradient(#000000 1px, #e5e5f7 1px);
    background-size: 30px 30px;
    z-index: -2;
    pointer-events: none;
}

/* Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-star, .floating-heart, .floating-pixel {
    position: absolute;
    animation: float 6s ease-in-out infinite;
}

.floating-star {
    color: #4B305F;
    font-size: 20px;
    opacity: 0.6;
}

.floating-heart {
    color: #F9C5D1;
    font-size: 18px;
    opacity: 0.7;
}

.floating-pixel {
    width: 8px;
    height: 8px;
    background: #C8A2C8;
    border-radius: 2px;
    opacity: 0.5;
}

.star-1 { top: 15%; left: 10%; animation-delay: 0s; }
.star-2 { top: 80%; left: 85%; animation-delay: 2s; }
.star-3 { top: 40%; left: 90%; animation-delay: 4s; }
.heart-1 { top: 70%; left: 15%; animation-delay: 1s; }
.heart-2 { top: 25%; left: 80%; animation-delay: 3s; }
.pixel-1 { top: 60%; left: 20%; animation-delay: 0.5s; }
.pixel-2 { top: 30%; left: 70%; animation-delay: 2.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* Back button */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 248, 251, 0.9);
    border: 2px solid #4B305F;
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
    color: #4B305F;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(75, 48, 95, 0.2);
    font-family: 'Pixelify Sans', cursive;
}

.back-btn.show {
    display: flex;
}

.back-btn:hover {
    background: rgba(255, 248, 251, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 48, 95, 0.3);
}

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

/* Page system */
.page {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Main container */
.container {
    position: relative;
    z-index: 1;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 80px 20px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header section */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease;
    width: 100%;
}

.logo {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #4B305F 0%, #C8A2C8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(75, 48, 95, 0.3);
    font-family: 'Pixelify Sans', cursive;
    position: relative;
}

.logo::after {
    content: '♡';
    position: absolute;
    top: -10px;
    right: -20px;
    font-size: 20px;
    color: #F9C5D1;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.subtitle {
    font-size: 14px;
    letter-spacing: 4px;
    opacity: 0.7;
    font-weight: 300;
    color: #4B305F;
    background: rgba(255, 248, 251, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #C8A2C8;
}

/* Profile section */
.profile {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeIn 1s ease 0.3s both;
    width: 100%;
    max-width: 500px;
}

.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #C8A2C8;
    box-shadow: 0 0 20px rgba(200, 162, 200, 0.3), 0 0 40px rgba(255, 248, 251, 0.5);
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
    position: relative;
    z-index: 2;
}

.avatar-frame {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid #F9C5D1;
    border-radius: 50%;
    animation: rotate 10s linear infinite;
    z-index: 1;
}

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

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(200, 162, 200, 0.5), 0 0 50px rgba(255, 248, 251, 0.7);
}

.bio {
    font-size: 15px;
    line-height: 1.8;
    color: #4B305F;
    background: rgba(255, 248, 251, 0.9);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 2px solid #C8A2C8;
    position: relative;
}

/* Icon Images */
.icon-img {
    width: 51px;
    height: 51px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    padding: 4px;
}

/* Image optimization */
.avatar, .icon-img, .gallery-frame img {
    content-visibility: auto;
}

/* Links section */
.links {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
    animation: fadeIn 1s ease 0.6s both;
}

.link-card {
    background: rgba(255, 248, 251, 0.9);
    border: 2px solid #C8A2C8;
    border-radius: 16px;
    padding: 18px 25px;
    text-decoration: none;
    color: #4B305F;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(200, 162, 200, 0.2), transparent);
    transition: left 0.6s ease;
}

.link-card:hover::before {
    left: 100%;
}

.link-card:hover {
    background: rgba(255, 248, 251, 1);
    border-color: #4B305F;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(75, 48, 95, 0.2), 0 5px 15px rgba(255, 248, 251, 0.5);
}

.link-card:active {
    transform: translateY(-2px);
}

.pixel-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(200, 162, 200, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.link-card:hover .pixel-icon {
    transform: scale(1.2) rotate(5deg);
    background: rgba(200, 162, 200, 0.3);
}

.link-text {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    font-family: 'Pixelify Sans', cursive;
}

.link-dots {
    opacity: 0.6;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    color: #4B305F;
}

.link-card:hover .link-dots {
    opacity: 1;
    transform: scale(1.2);
}

/* Contact button */
.contact-btn {
    background: linear-gradient(135deg, #4B305F 0%, #C8A2C8 100%);
    color: #FFF8FB;
    border: none;
    justify-content: center;
    font-weight: 600;
    position: relative;
}

.contact-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 248, 251, 0.2) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-btn:hover::after {
    opacity: 1;
}

.contact-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(75, 48, 95, 0.4);
}

/* Donation button variant */
.donation-btn {
    background: linear-gradient(135deg, #F9C5D1 0%, #C8A2C8 100%);
    color: #4B305F;
    border: none;
}

.donation-btn:hover {
    background: linear-gradient(135deg, #C8A2C8 0%, #F9C5D1 100%);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(200, 162, 200, 0.5);
}

/* Content pages */
.content-section {
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(135deg, #4B305F 0%, #C8A2C8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(75, 48, 95, 0.3);
    font-family: 'Pixelify Sans', cursive;
    position: relative;
}

.content-section h2::after {
    content: '♡';
    position: absolute;
    top: -5px;
    right: -25px;
    color: #F9C5D1;
    font-size: 20px;
}

.content-section p {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
    color: #4B305F;
    background: rgba(255, 248, 251, 0.9);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 2px solid #C8A2C8;
}

/* Gallery grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 30px;
}

.gallery-item {
    background: rgba(255, 248, 251, 0.9);
    border: 2px solid #C8A2C8;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

.gallery-frame {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
}

.gallery-frame img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

.gallery-caption {
    padding: 15px;
    text-align: center;
    font-size: 14px;
    color: #4B305F;
    font-weight: 500;
    background: rgba(255, 248, 251, 0.9);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(75, 48, 95, 0.2), 0 10px 25px rgba(255, 248, 251, 0.5);
    border-color: #4B305F;
}

/* Character Animation Elements */
.character-animation {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.character-animation {
    position: relative;
    width: 120px;
    height: 140px;
    animation: bounce 2s ease-in-out infinite;
}

.character-ears {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 80px;
    background: #4B305F;
    border-radius: 50% 50% 40% 40%;
    z-index: 1;
}

.character-ears::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -20px;
    width: 60px;
    height: 40px;
    background: #4B305F;
    border-radius: 50%;
    transform: rotate(-25deg);
}

.character-ears::after {
    content: '';
    position: absolute;
    top: -15px;
    right: -20px;
    width: 60px;
    height: 40px;
    background: #4B305F;
    border-radius: 50%;
    transform: rotate(25deg);
}

.character-face {
    position: absolute;
    top: 20px;
    left: 30px;
    width: 60px;
    height: 70px;
    background: #FFF8FB;
    border-radius: 45% 45% 50% 50%;
    z-index: 2;
}

.character-flower {
    position: absolute;
    top: 10px;
    right: 20px;
    width: 20px;
    height: 20px;
    background: #F9C5D1;
    border-radius: 50%;
    z-index: 3;
    animation: spin 4s linear infinite;
}

.chef-hat {
    position: absolute;
    top: -10px;
    left: 40px;
    font-size: 24px;
    z-index: 3;
    animation: bounce 1.5s ease-in-out infinite;
}

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

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

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    animation: fadeIn 1s ease 1.2s both;
}

.footer-text {
    font-size: 12px;
    color: #4B305F;
    font-weight: 500;
    background: rgba(255, 248, 251, 0.9);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid #C8A2C8;
    font-family: 'Pixelify Sans', cursive;
}

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

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

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

/* Focus styles for accessibility */
.link-card:focus-visible,
.back-btn:focus-visible {
    outline: 2px solid #4B305F;
    outline-offset: 2px;
}
.container {
    display: none;
    align-items: center;
    justify-content: center;
    width: 90vw;;
    height: 85vh;
    background-color: white;
    flex-direction: row;
}

/* Health Calculator Styles */
.calculator-form {
    background: rgba(255, 248, 251, 0.9);
    border: 2px solid #C8A2C8;
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4B305F;
    font-family: 'Pixelify Sans', cursive;
    font-size: 16px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #C8A2C8;
    border-radius: 10px;
    background: rgba(255, 248, 251, 0.8);
    font-family: 'Pixelify Sans', cursive;
    font-size: 15px;
    color: #4B305F;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #4B305F;
    background: rgba(255, 248, 251, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(75, 48, 95, 0.2);
}

.input-group input::placeholder {
    color: #C8A2C8;
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #4B305F 0%, #C8A2C8 100%);
    color: #FFF8FB;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Pixelify Sans', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(75, 48, 95, 0.3);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.results {
    margin-top: 30px;
    animation: fadeIn 0.6s ease;
}

.result-card {
    background: rgba(255, 248, 251, 0.9);
    border: 2px solid #C8A2C8;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(75, 48, 95, 0.2);
    border-color: #4B305F;
}

.result-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
}

.result-content h3 {
    font-size: 18px;
    color: #4B305F;
    margin-bottom: 8px;
    font-family: 'Pixelify Sans', cursive;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: #4B305F;
    margin-bottom: 5px;
    font-family: 'Pixelify Sans', cursive;
}

.result-category,
.result-info {
    font-size: 14px;
    color: #C8A2C8;
    font-weight: 500;
}

/* BMI Categories Colors */
.bmi-underweight { color: #FF9800; }
.bmi-normal { color: #4CAF50; }
.bmi-overweight { color: #FFC107; }
.bmi-obese { color: #F44336; }

.calculator-icon {
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 28px;
    z-index: 3;
    animation: bounce 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 36px;
        letter-spacing: 2px;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .link-card {
        padding: 15px 20px;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .character-animation {
        transform: scale(0.8);
    }
    
    .calculator-form {
        padding: 20px;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .result-icon {
        font-size: 28px;
    }
    
    .result-value {
        font-size: 20px;
    }
    
    .turnstile-widget {
        margin: 20px 0;
        transform: scale(0.95);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 60px 15px 30px;
    }
    
    .logo {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 12px;
        letter-spacing: 2px;
    }
    
    .link-text {
        font-size: 14px;
    }
    
    .content-section h2 {
        font-size: 24px;
    }
    
    .calculator-form {
        padding: 15px;
    }
    
    .input-group input,
    .input-group select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .calculate-btn {
        padding: 12px;
        font-size: 16px;
    }
    
    .turnstile-widget {
        transform: scale(0.85);
        margin: 15px 0;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 600px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .container {
        max-width: 680px;
    }

    .link-card {
        padding: 20px 30px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* High-resolution displays */
@media (min-width: 1920px) {
    .container {
        max-width: 800px;
    }
    
    .logo {
        font-size: 56px;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimize rendering */
* {
    backface-visibility: hidden;
}