/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* Header and Navigation */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

header .header-logo {
    height: 3rem !important; /* Double size for better visibility */
    width: auto !important;
    max-width: 120px !important; /* Double width limit */
    margin-right: 1rem !important;
    object-fit: contain !important;
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

/* Sidebar Navigation */
nav {
    position: fixed;
    left: 0;
    top: 80px;
    width: 280px;
    height: calc(100vh - 80px);
    background-color: var(--white);
    box-shadow: var(--shadow);
    overflow-y: auto;
    padding: 1rem 0;
    z-index: 50;
}

.nav-btn {
    display: block;
    width: 100%;
    background-color: transparent;
    color: var(--text-color);
    border: none;
    border-left: 4px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.nav-btn:hover {
    background-color: var(--light-bg);
    border-left-color: var(--accent-color);
}

.nav-btn.active {
    background-color: var(--light-bg);
    border-left-color: var(--accent-color);
    color: var(--accent-color);
    font-weight: 600;
}

/* Hierarchical menu styles */
.nav-item {
    margin: 0;
}

.nav-item.has-children > .nav-btn::after {
    content: '▼';
    float: right;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-item.has-children.expanded > .nav-btn::after {
    transform: rotate(-180deg);
}

.nav-children {
    display: none;
    background-color: #f5f5f5;
}

.nav-item.expanded > .nav-children {
    display: block;
}

.nav-children .nav-btn {
    padding-left: 2.5rem;
    font-size: 0.95rem;
}

.nav-children .nav-children .nav-btn {
    padding-left: 3.5rem;
    font-size: 0.9rem;
}

/* Main Content */
main {
    margin-left: 280px;
    margin-top: 80px;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

.carousel-slide .artist-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: var(--white);
    padding: 2rem 1rem 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-arrow.prev {
    left: 1rem;
}

.carousel-arrow.next {
    right: 1rem;
}

.carousel-arrow:disabled {
    display: none;
}

.carousel-dots {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background-color: var(--white);
}

.carousel-dot:disabled {
    display: none;
}

/* Gallery Grid Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img,
.gallery-item picture {
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-item img {
    object-fit: contain;
    background-color: #f0f0f0;
}

.gallery-item picture img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: #f0f0f0;
}

.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background-color: transparent;
    color: var(--white);
    border: none;
    font-size: 3rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
    line-height: 1;
    padding: 0.5rem;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* Contact Form Styles */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.contact-container h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.contact-container > p {
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

.submit-btn {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.submit-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.form-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.form-feedback.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-feedback.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Honeypot field - hidden from users */
.honeypot-field {
    position: absolute;
    left: -9999px;
}

/* reCAPTCHA container */
.recaptcha-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 60px; /* Add body padding to account for fixed header */
    }

    header {
        padding: 0.75rem 1rem;
        position: fixed; /* Ensure header stays fixed */
        height: 60px; /* Set fixed height for mobile */
        z-index: 100;
    }
    
    .header-content {
        justify-content: flex-start; /* Align logo and title to left on mobile */
    }
    
    header .header-logo {
        height: 2rem !important; /* Double size for mobile */
        max-width: 80px !important; /* Double width limit on mobile */
        margin-right: 0.75rem !important;
        object-fit: contain !important;
        width: auto !important;
    }
    
    header h1 {
        font-size: 1.2rem;
    }

    nav {
        width: 100%;
        height: auto;
        position: static;
        max-height: 50vh; /* Use viewport height instead of fixed pixels */
        min-height: 200px; /* Ensure minimum space for at least Home and Contact */
        overflow-y: auto;
        overflow-x: hidden;
        border-bottom: 2px solid var(--primary-color);
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        /* Add subtle scroll indicator */
        background: linear-gradient(white 30%, rgba(255,255,255,0)),
                   linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
                   radial-gradient(50% 0, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)),
                   radial-gradient(50% 100%, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
        background-color: white;
        background-repeat: no-repeat;
        background-attachment: local, local, scroll, scroll;
        background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
        z-index: 50; /* Explicitly set nav z-index */
    }
    
    /* Ensure Home button is always visible by giving it priority */
    .nav-item:first-child {
        position: sticky;
        top: 0;
        background: white;
        z-index: 51; /* Higher than nav z-index but below header */
        border-bottom: 1px solid #eee;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Add shadow to separate from content below */
    }

    main {
        margin-left: 0;
        margin-top: 0;
        padding: 1rem;
    }

    .carousel {
        height: 400px;
    }

    .carousel-arrow {
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
    }

    .carousel-arrow.prev {
        left: 0.5rem;
    }

    .carousel-arrow.next {
        right: 0.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    nav {
        max-height: 40vh; /* Reduce max height on very narrow screens */
        min-height: 150px; /* Smaller minimum height */
    }
    
    /* Make Home button even more prominent on narrow screens */
    .nav-item:first-child .nav-btn {
        font-weight: 700;
        background-color: var(--light-bg);
        border-left-color: var(--accent-color);
    }

    .carousel {
        height: 300px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .contact-container {
        padding: 1rem;
    }
}

/* Additional breakpoint for very narrow screens */
@media (max-width: 360px) {
    nav {
        max-height: 35vh;
        min-height: 120px;
    }
    
    /* Ensure nav items are compact on very small screens */
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-children .nav-btn {
        padding-left: 2rem;
        font-size: 0.85rem;
    }
    
    .nav-children .nav-children .nav-btn {
        padding-left: 2.5rem;
        font-size: 0.8rem;
    }
}
