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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
    color: #000;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scrollbar on body */
}

/* Header styles */
header {
    text-align: center;
    padding: 1rem 0 0 0;
    background-color: #1e1e1e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #333;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    height: 150px;
    width: auto;
    object-fit: contain;
    margin-bottom: -3px;
}

.header-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    letter-spacing: 1px;
}

.header-text p {
    font-size: 1.1rem;
    color: #bbbbbb;
}

/* Gallery container */
.gallery-container {
    padding: 4rem 0 0;
    overflow: hidden;
    position: relative;
}

/* Horizontal scrolling gallery */
.gallery {
    display: flex;
    overflow-x: auto;
    scroll-behavior: auto; /* We'll handle smooth scrolling manually */
    padding: 1rem;
    gap: 2rem;
    scrollbar-width: none; /* Hide scrollbar */
    -ms-overflow-style: none;
    /* Performance optimizations */
    will-change: scroll-position;
    transform: translateZ(0); /* Hardware acceleration */
    -webkit-transform: translateZ(0);
}

.gallery::-webkit-scrollbar {
    display: none; /* Hide scrollbar for WebKit browsers */
}

/* Artwork card */
.artwork-card {
    flex: 0 0 auto;
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #333;
    /* Performance optimization */
    will-change: transform;
    transform: translateZ(0);
}

.artwork-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border-color: #444;
}

.artwork-image {
    width: 400px;
    object-fit: cover;
    display: block;
    /* Performance optimization */
    transform: translateZ(0);
}

.artwork-info {
    padding: 1.5rem;
}

.artwork-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.artwork-info p {
    color: #bbbbbb;
    font-size: 1rem;
}

.artwork-price {
    font-weight: bold;
    color: #ffffff;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #1e1e1e;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideIn 0.3s ease;
    border: 1px solid #333;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: #2a2a2a;
    color: #ffffff;
    border-bottom: 1px solid #333;
}

.modal-title h2 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.modal-title p {
    font-size: 1rem;
    opacity: 0.8;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    background: #666;
    padding: 0.5rem 1rem;
    min-width: 120px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    background-color: #333;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    border: 1px solid #444;
}

.btn:hover {
    background-color: #444;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #ffffff;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

#modalArtworkImage {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 4px;
}

.artwork-details .price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 1rem;
}

.artwork-details .description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #cccccc;
}

.artwork-details .confession {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #cccccc;
}

.codex-link-container {
    margin: 2rem 0;
    text-align: center;
}

.codex-link {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #444;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    border: 1px solid #555;
}

.codex-link:hover {
    background-color: #555;
    transform: translateY(-2px);
}

.artwork-details h3 {
    margin-top: 1rem;
    color:#eeeeee;
}
/* Navigation arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(30, 30, 30, 0.7);
    border: 1px solid #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.5rem;
    opacity: 0.7;
    /* Performance optimization */
    will-change: opacity, background-color;
}

.nav-arrow:hover {
    opacity: 1;
    background-color: rgba(50, 50, 50, 0.9);
}

.nav-arrow.left {
    left: 20px;
}

.nav-arrow.right {
    right: 20px;
}

footer {
    text-align: center;
    padding: 2rem 1rem 0;
    color: #bbbbbb;
}

footer p {
    font-size: 1rem;
}

footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #cccccc;
    text-decoration: underline;
}


@media (max-width: 1350px) {

    .artwork-image {
        width: 350px;
    }

    .gallery-container {
        padding: 3rem 0 0;
    }

}

/* Responsive design */
@media (max-width: 768px) {

    footer {
        padding-top: 1rem;
    }

    .gallery-container {
        padding: 2rem 0 0;
    }

    .artwork-image {
        width: 100%;

    }
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1.5em;
    }
    
    .logo {
        height: 125px;
    }
    
    .header-text h1 {
        font-size: 2rem;
        margin-bottom: 0;
    }
    
    .artwork-card {
        width: 250px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        position:relative;
    }

    .close{
        position: absolute;
        right: 0;
        top: 0;
        padding: 0.5em 1em;
    }
    
    .modal-price {
        font-size: 1.3rem;
        min-width: auto;
    }
    
    .modal-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .nav-arrow.left {
        left: 10px;
    }
    
    .nav-arrow.right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0 1rem;
    }
    
    .header-text h1 {
        font-size: 1.7rem;
    }
    
    .gallery {
        gap: 1.5rem;
        padding: 0.5rem;
    }
    
    .artwork-card {
        width: 220px;
    }

    .modal-header{
        padding:1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .artwork-details .description {
        font-size: 1rem;
    }

    .modal-title h2 {
        font-size: 1.25rem;
    }

    .modal-price{
        font-size: 1rem;
    }

    .modal-body{
        max-height: 55vh;
    }
}