/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000000;
    color: #ffffff;
    /* line-height: 1.2; */
    overflow-x: hidden;
}

/* Navigation Styles */
.navbar {
    background-color: #1a1a1a;
    border-bottom: 1px solid #333333;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-profile {
    display: flex;
    align-items: center;
}

.profile-link {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-icon {
    font-size: 2rem;
    color: #ffffff;
    transition: all 0.3s ease;
}

.profile-link:hover .profile-icon {
    color: #cccccc;
    transform: scale(1.1);
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-link:hover {
    background-color: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.nav-link.active {
    background-color: #ffffff;
    color: #000000;
}

.nav-link i {
    font-size: 1.1rem;
}

/* Hamburger Menu Toggle Button (Hidden on Desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Hamburger Animation when Active */
.nav-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    /* Show hamburger menu on mobile */
    .nav-toggle {
        display: flex;
    }
    
    /* Hide nav links by default on mobile */
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 70px);
        background-color: #1a1a1a;
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1rem;
        gap: 1rem;
        transition: right 0.3s ease;
        border-left: 1px solid #333333;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }
    
    /* Show nav links when active */
    .nav-links.active {
        right: 0;
    }
    
    /* Full width nav links on mobile */
    .nav-link {
        width: 100%;
        padding: 1rem;
        border-radius: 8px;
        justify-content: flex-start;
    }
    
    .nav-link:hover {
        transform: translateX(5px);
    }
}

@media (max-width: 480px) {
    .nav-links {
        width: 70vw;
        max-width: 280px;
    }
    
    .profile-icon {
        font-size: 1.5rem;
    }
}

/* Main Content */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 160px);
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 2rem 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.8) 100%);
    border-radius: 15px;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    display: flex;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    text-align: start;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: #cccccc;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-description {
    font-size: 1.1rem;
    color: #999999;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    text-align: start;
}

/* Gallery Section */
.gallery-section {
    padding: 2rem 0.2rem;
}

.gallery-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
}

.gallery-header-content {
    display: flex;
    flex-direction: column;
}

.section-title {
    text-align: left;
    font-size: 2.5rem;
    font-weight: 700;    
    margin-bottom: 1rem;
    color: #ffffff;
}

.gallery-header-content p {
    text-align: start;
}

.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.artwork-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.artwork-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.artwork-image {
    width: 100%;
    height: 320px;
    background: linear-gradient(45deg, #333333, #555555);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.artwork-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.artwork-card:hover .artwork-image::before {
    opacity: 1;
}

.artwork-info {
    padding: 1.5rem;
}

.artwork-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.artwork-category {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.artwork-description {
    color: #cccccc;
    font-size: 1rem;
    line-height: 1.6;
}

/* Individual Artwork Page */
.artwork-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.artwork-detail-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.artwork-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.artwork-detail-category {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.artwork-detail-description {
    color: #cccccc;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    border-top: 1px solid #333333;
    padding: 2rem;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
    color: #999999;
    
}

.footer-content p {
    font-size: 1rem;
    
}

/* Filter Button Styles */
.filter-buttons {
    display: flex;
    justify-content: end;
    gap: 0.5rem;
    /* margin-bottom: 3rem; */
    flex-wrap: nowrap;
    /* overflow-x: auto; */
    padding-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.2;
    /* Override browser button defaults */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Force remove any browser default heights */
    min-height: 0;
    height: 32px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.filter-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.filter-btn.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

/* Loading States */
.htmx-request .artwork-grid {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-request .filter-btn {
    opacity: 0.7;
    pointer-events: none;
}

/* Image Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 0.9rem;
}

.artwork-card:hover .image-overlay {
    opacity: 1;
}

.artwork-image img {
    width: 100%;
    height: 320px;
    object-fit: contain;
    border-radius: 15px 15px 0 0;
    transition: transform 0.3s ease;
    background-color: #1a1a1a;
}

.artwork-card:hover .artwork-image img {
    transform: scale(1.05);
}

.image-placeholder {
    border-radius: 15px 15px 0 0;
}

/* Gallery-specific grid - inherits from .artwork-grid */
.gallery-grid {
    /* Inherits all styles from .artwork-grid */
}

/* Gallery-specific card - inherits from .artwork-card */
.gallery-card {
    /* Inherits all styles from .artwork-card */
    cursor: pointer; /* Only difference: gallery cards are clickable */
}

/* Gallery card expansion styles */
.gallery-card.expanded {
    /* When expanded, make the card show only the image */
    overflow: hidden;
}

.gallery-card.expanded .artwork-image {
    height: 100%;
    border-radius: 15px;
    
}

.gallery-card.expanded .artwork-image img {
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
}

/* Responsive Design */
@media (max-width: 1140px) {
    .hero-section {
        padding: 2rem 1rem;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
        /* flex-direction: column; */
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .artwork-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* Tablet Portrait - 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
    .artwork-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Gallery - 2 columns from 589px to 1043px */
@media (min-width: 589px) and (max-width: 1043px) {
    .gallery-page .artwork-grid.gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile - Horizontal Carousel for Featured Artworks ONLY */
@media (max-width: 468px) {
    /* Target featured section on home page only */
    body:not(.gallery-page) .gallery-section .artwork-grid {
        display: flex !important;
        flex-direction: row;
        overflow-x: scroll;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        width: 100%;
        gap: 0;
        padding: 0;
        align-items: stretch;
    }

    body:not(.gallery-page) .gallery-section .artwork-grid::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome, Safari and Opera */
    }

    body:not(.gallery-page) .gallery-section .artwork-card {
        flex: 0 0 calc(100vw - 2rem);
        scroll-snap-align: center;
        display: inline-flex;
        flex-direction: column;
        margin-right: 1rem;
        min-width: calc(100vw - 2rem);
        box-sizing: border-box;
    }

    body:not(.gallery-page) .gallery-section .artwork-card:last-child {
        margin-right: 0;
    }

    body:not(.gallery-page) .gallery-section .artwork-image {
        width: 100%;
        height: 250px;
    }

    body:not(.gallery-page) .gallery-section .artwork-image img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }
}

/* Very small screens - 1 column from 480px and under */
@media (max-width: 480px) {
    .artwork-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-section {
        padding: 2rem 1rem;
        display: flex;
        flex-direction: column;
    }
}
