* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 100px;
}

:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --accent-color: #bb86fc;
    --arrow-bg: rgba(255, 255, 255, 0.1);
    --arrow-hover: rgba(255, 255, 255, 0.2);
    --header-height: 60px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

#app {
    position: relative;
    padding-top: var(--header-height);
}

/* Header Styles */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(18, 18, 18, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-arrow {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    padding: 10px;
    transition: color 0.3s;
    user-select: none;
}

.header-arrow:hover {
    color: var(--accent-color);
}

#header-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
}

.tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    top: 150%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Responsive Tooltip for Mobile */
@media (max-width: 768px) {
    .tooltip-text {
        position: fixed;
        top: calc(var(--header-height) + 10px);
        left: 50%;
        margin-left: 0;
        transform: translateX(-50%);
        width: 90%;
        max-width: 350px;
        text-align: left;
    }

    .tooltip-text::after {
        display: none;
    }
}

.content-container {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: 40px 0;
    text-align: center;
    transition: opacity 0.3s ease;
}

h1 {
    font-weight: 300;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: center;
    padding: 0 20px;
}

.gallery img {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    dynamic-range-limit: standard;
}

/* Only apply opacity transition on desktop devices (non-touch) to avoid flickering on iPad */
@media (hover: hover) and (pointer: fine) {
    .gallery img {
        transition: transform 0.3s ease, opacity 0.5s ease;
    }
}

.gallery img:hover {
    transform: scale(1.01);
}

.nav-arrow {
    position: fixed;
    top: var(--header-height);
    /* Adjust for header */
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 3rem;
    color: var(--text-color);
    background-color: transparent;
    transition: background-color 0.3s, opacity 0.3s;
    z-index: 10;
    opacity: 0;
}

.nav-arrow:hover {
    background-color: var(--arrow-bg);
    opacity: 1 !important;
}

#nav-left {
    left: 0;
}

#nav-right {
    right: 0;
}

.nav-arrow-vertical {
    position: fixed;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 3rem;
    color: var(--text-color);
    background-color: transparent;
    transition: background-color 0.3s, opacity 0.3s;
    z-index: 10;
    opacity: 0;
}

.nav-arrow-vertical:hover {
    background-color: var(--arrow-bg);
    opacity: 1 !important;
}

#nav-top {
    top: var(--header-height);
    /* Adjust for header */
}

#nav-top span {
    transform: rotate(90deg);
}

#nav-bottom {
    bottom: 0;
}

#nav-bottom span {
    transform: rotate(90deg);
}

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden !important;
}

/* ========================================
   GALLERY PAGE STYLES (all.html)
   ======================================== */

#gallery-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#gallery-header {
    background-color: rgba(18, 18, 18, 0.98);
    border-bottom: 1px solid rgba(187, 134, 252, 0.3);
    padding: 30px 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

#gallery-header h1 {
    font-size: 2rem;
    font-weight: 300;
    margin: 0;
    color: var(--accent-color);
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 40px 20px;
    justify-content: flex-start;
    max-width: 2000px;
    margin: 0 auto;
}

.thumbnail-box {
    width: 450px;
    height: 100px;
    display: flex;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.thumbnail-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(187, 134, 252, 0.3);
    background-color: rgba(255, 255, 255, 0.08);
}

.thumbnail-image-container {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.3);
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-info {
    flex: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.thumbnail-date {
    font-size: 0.85rem;
    color: #888;
    font-weight: 300;
}

.thumbnail-title {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 400;
    line-height: 1.3;
}

/* Responsive design for smaller screens */
@media (max-width: 450px) {
    .thumbnail-box {
        width: 100%;
        /* Scale proportionally based on viewport width */
        height: calc(100vw * 100 / 450);
        max-height: 100px;
    }

    .thumbnail-image-container {
        /* Maintain square aspect ratio */
        width: calc(100vw * 100 / 450);
        height: calc(100vw * 100 / 450);
        max-width: 100px;
        max-height: 100px;
    }

    .thumbnail-info {
        padding: 10px 15px;
    }

    .thumbnail-date {
        font-size: 0.75rem;
    }

    .thumbnail-title {
        font-size: 0.95rem;
    }

    #gallery-header h1 {
        font-size: 1.5rem;
    }

    .gallery-grid {
        padding: 20px 10px;
        gap: 15px;
    }
}

/* Tablet and medium screens */
@media (min-width: 451px) and (max-width: 900px) {
    .gallery-grid {
        gap: 15px;
    }
}