:root {
    /* Default theme (Totoro-inspired) */
    --primary-color: #4A90E2;
    --secondary-color: #7BC950;
    --accent-color: #F5D76E;
    --text-color: #333333;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --shadow-color: rgba(0,0,0,0.1);
    --gradient-start: #f5f7fa;
    --gradient-end: #c3cfe2;
}

/* Spirited Away theme */
[data-theme="spirited-away"] {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --text-color: #2C3E50;
    --bg-color: #F7F9FC;
    --card-bg: #ffffff;
    --shadow-color: rgba(0,0,0,0.1);
    --gradient-start: #F7F9FC;
    --gradient-end: #E9ECEF;
}

/* Princess Mononoke theme */
[data-theme="mononoke"] {
    --primary-color: #2E7D32;
    --secondary-color: #81C784;
    --accent-color: #FFB74D;
    --text-color: #1B1B1B;
    --bg-color: #E8F5E9;
    --card-bg: #ffffff;
    --shadow-color: rgba(0,0,0,0.1);
    --gradient-start: #E8F5E9;
    --gradient-end: #C8E6C9;
}

/* Howl's Moving Castle theme */
[data-theme="howl"] {
    --primary-color: #9C27B0;
    --secondary-color: #FF9800;
    --accent-color: #00BCD4;
    --text-color: #212121;
    --bg-color: #F3E5F5;
    --card-bg: #ffffff;
    --shadow-color: rgba(0,0,0,0.1);
    --gradient-start: #F3E5F5;
    --gradient-end: #E1BEE7;
}

/* Dark theme variants */
[data-theme="dark-totoro"] {
    --primary-color: #2C3E50;
    --secondary-color: #34495E;
    --accent-color: #3498DB;
    --text-color: #ECF0F1;
    --bg-color: #1A1A1A;
    --card-bg: #2D2D2D;
    --shadow-color: rgba(0,0,0,0.5);
    --gradient-start: #1A1A1A;
    --gradient-end: #2D2D2D;
}

[data-theme="dark-spirited"] {
    --primary-color: #E74C3C;
    --secondary-color: #2C3E50;
    --accent-color: #F1C40F;
    --text-color: #ECF0F1;
    --bg-color: #2C3E50;
    --card-bg: #34495E;
    --shadow-color: rgba(0,0,0,0.5);
    --gradient-start: #2C3E50;
    --gradient-end: #34495E;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card-bg);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 2px 10px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.theme-switcher:hover {
    transform: scale(1.1);
}

.theme-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out, background-color 0.3s ease;
}

.loading-screen p {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-top: 1rem;
    text-shadow: 1px 1px 2px var(--shadow-color);
}

.totoro-loader {
    width: 100px;
    height: 100px;
    background: url('Home-Media/totoro-loader.gif') no-repeat center;
    background-size: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--shadow-color));
}

/* Home Page Styles */
.home-page {
    padding: 2rem;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.ghibli-title {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: float 3s ease-in-out infinite;
}

.character-intro {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.character-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.character-description {
    max-width: 500px;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #333;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease;
    background: var(--card-bg);
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Explore Button */
.explore-button-container {
    text-align: center;
    margin: 3rem 0;
}

.explore-button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: var(--primary-color);
    color: var(--card-bg);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.explore-button:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.button-spirit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.explore-button:hover .button-spirit {
    width: 300px;
    height: 300px;
}

/* Gallery Page Styles */
.gallery-page {
    padding: 2rem;
}

.gallery-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.back-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.back-button:hover {
    color: var(--secondary-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: var(--card-bg);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.prev-button,
.next-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
}

.prev-button {
    left: 20px;
}

.next-button {
    right: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .character-intro {
        flex-direction: column;
    }

    .character-image {
        width: 200px;
        height: 200px;
    }

    .ghibli-title {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Update dark theme text visibility */
[data-theme="dark-totoro"] .character-description,
[data-theme="dark-spirited"] .character-description {
    color: var(--text-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

[data-theme="dark-totoro"] .ghibli-title,
[data-theme="dark-spirited"] .ghibli-title {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: var(--accent-color);
}

/* Improve dark theme contrast */
[data-theme="dark-totoro"],
[data-theme="dark-spirited"] {
    --text-color: #ECF0F1;
    --shadow-color: rgba(0,0,0,0.5);
}

[data-theme="dark-totoro"] .portfolio-item,
[data-theme="dark-totoro"] .gallery-item,
[data-theme="dark-spirited"] .portfolio-item,
[data-theme="dark-spirited"] .gallery-item {
    border: 1px solid rgba(255,255,255,0.1);
}

[data-theme="dark-totoro"] .explore-button,
[data-theme="dark-spirited"] .explore-button {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

[data-theme="dark-totoro"] .theme-switcher,
[data-theme="dark-spirited"] .theme-switcher {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Add subtle text glow for dark themes */
[data-theme="dark-totoro"] h1,
[data-theme="dark-spirited"] h1 {
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

/* Improve button visibility in dark themes */
[data-theme="dark-totoro"] .explore-button,
[data-theme="dark-spirited"] .explore-button {
    background: var(--accent-color);
    color: var(--bg-color);
}

[data-theme="dark-totoro"] .explore-button:hover,
[data-theme="dark-spirited"] .explore-button:hover {
    background: var(--primary-color);
}

/* Add subtle hover effects for dark themes */
[data-theme="dark-totoro"] .portfolio-item:hover,
[data-theme="dark-totoro"] .gallery-item:hover,
[data-theme="dark-spirited"] .portfolio-item:hover,
[data-theme="dark-spirited"] .gallery-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* Improve back button visibility in dark themes */
[data-theme="dark-totoro"] .back-button,
[data-theme="dark-spirited"] .back-button {
    color: var(--accent-color);
}

[data-theme="dark-totoro"] .back-button:hover,
[data-theme="dark-spirited"] .back-button:hover {
    color: var(--primary-color);
} 