/*
 * ==========================================
 * TABLE OF CONTENTS
 * ==========================================
 * 1. Variables & Base Defaults
 * 2. Typography & Globals
 * 3. Loading Screen & Overlays
 * 4. Layout & Content Wrappers
 * 5. Navigation (Tabs & Arrows)
 * 6. UI Components (Cards, Skills, Badges)
 * 7. Highlights Section & Orbs
 * 8. Modals (Images & 3D Viewer)
 * 9. Media Queries (Mobile Adjustments)
 * ==========================================
 */

/* 1. Variables & Base Defaults */

/* Genshin Impact Color Palette & Base */
:root {
    --genshin-dark: rgb(43, 51, 68);
    --genshin-light: #ece5d8;
    --genshin-gold: #d3bc8e;
    --genshin-gold-glow: rgba(211, 188, 142, 0.5);
    --genshin-glass: rgba(30, 35, 50, 0.4);
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    color: var(--genshin-light);
    background-color: var(--genshin-dark);
}

html {
    scroll-behavior: auto;
    scrollbar-color: var(--genshin-gold) var(--genshin-dark);
    /* thumb color | track color */
    scrollbar-width: auto;
    /* Options: auto, thin, none */
}

/* 2. Typography & Globals */

h1 {
    font-size: 2.8rem;
    color: var(--genshin-light);
    text-shadow: 0 0 15px var(--genshin-gold-glow);
    letter-spacing: 2px;
}

h2 {
    color: var(--genshin-gold);
    text-shadow: 0 0 20px rgba(211, 188, 142, 0.5);
    border-bottom: 1px solid rgba(211, 188, 142, 0.3);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    color: var(--genshin-light);
    text-shadow: 0 0 20px rgba(211, 192, 155, 0.5);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

a {
    color: var(--genshin-gold);
    text-decoration: none;
    transition: text-shadow 0.2s;
}

a:hover {
    text-shadow: 0 0 8px var(--genshin-gold-glow);
}

header {
    text-align: center;
    padding: 1rem;
}

footer {
    text-align: center;
    /* position: sticky; */
    padding: 2rem 1rem;
    opacity: 1;
    /* bottom: 0; */
    font-size: 0.9rem;
    margin-top: 1rem;
    background: linear-gradient(to top, rgba(15, 20, 35, 0.9) 0%, transparent);
}

/* 3. Loading Screen & Overlays */
#loading-screen {
    position: fixed;
    inset: 0;
    background-color: var(--genshin-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in, visibility 0.5s ease-out;
}

.loadingText {
    text-align: center;
    font-size: x-large;
    color: var(--genshin-gold);
    text-shadow: 0 0 20px rgba(211, 188, 142, 0.5);
}

/* Added via JS when loading is done */
#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner img{
    width: 200px;
    height: 200px;
    /* border: 4px solid rgba(211, 188, 142, 0.3); */
    /* border-top: 4px solid var(--genshin-gold);
    border-radius: 50%; */
    /* animation: spin 1s linear infinite; */
}
/* @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Adjusted for better contrast */
    background: rgba(15, 20, 35, 0.5);
    z-index: -1;
}

/* 4. Layout & Content Wrappers */
.content-wrapper {
    max-width: 900px;
    /* Changed margin to add 6rem at the top so it doesn't hide under the nav */
    margin: 6rem auto 0;
    min-height: 70vh;
}

.tab-content {
    display: none;
    animation: fadeIn 0.25s ease-out forwards;
    /* Hints the browser to prepare GPU layers */
    will-change: transform;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        transform: scale3d(0.5, 0.5, 0.1) translate3d(0, -67px, -500px);
        /* transform: translate3d(0px, 0px, 300px); */
    }

    to {
        transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
        /* transform: scale3d(1,1,1) (0,0,0); */
        /* transform: translate3d(0, 0, 0); */
    }
}

section {
    padding: 1rem;
}

/* 5. Navigation (Tabs & Arrows) */
/* Normal State (Top Center, Horizontal) */
.tabs-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    /* Reduced padding here to compensate for the padding added inside .tabs */
    padding: 0 0.5rem;
    z-index: 100;
    width: fit-content;

    background: var(--genshin-glass);
    border: 1px solid rgba(211, 188, 142, 0.3);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.tabs {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    /* This padding gives the 15px box-shadow enough room to render without hitting the overflow wall */
    padding: 15px 12px;

    /* Keep buttons on a single horizontal line and allow smooth touch scrolling on mobile */
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.scroll-arrow {
    display: none;
    /* Hidden on desktop */
}
.tabs::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.tab-button {
    background-color: rgba(43, 51, 68, 0.85);
    border: 2px solid rgba(211, 188, 142, 0.3);
    color: var(--genshin-light);
    padding: 0.6rem 1.8rem;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(5px);
    font-family: inherit;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.tab-button:hover {
    border-color: var(--genshin-gold);
    box-shadow: 0 0 8px 6px var(--genshin-gold-glow);

    background-color: rgba(60, 70, 90, 0.95);
}

.tab-button.active {
    background-color: var(--genshin-light);
    color: var(--genshin-dark);
    border-color: var(--genshin-light);
    box-shadow: 0 0 8px 6px var(--genshin-gold-glow);
}

/* 6. UI Components */
/* --- Wanderer Peeking Effect --- */
.card-container {
    position: relative;
    /* This anchors Wanderer now */
    margin-bottom: 1.5rem;
    /* Moved from .card to keep spacing correct */
}

.card {
    position: relative;
    /* This is required to anchor the absolute images */
    z-index: 5;
}

.about-card,
.card {
    background: var(--genshin-glass);
    border: 1px solid rgba(211, 188, 142, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, border-color 0.2s;
    /* z-index: 100; */
}

.about-card:hover,
.card:hover {
    border-color: rgba(211, 188, 142, 0.5);
}

.about-card {
    font-size: 18px;
    line-height: 1.6;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}

.card-header h3 {
    margin: 0;
}

.date {
    font-size: 0.9em;
    color: #a0a8b8;
}

.description {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #d8e0e8;
}

.description ul {
    padding-left: 1.2rem;
}

.description li {
    margin-bottom: 0.4rem;
}

.gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    padding-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--genshin-gold) transparent;
}

.gallery::-webkit-scrollbar {
    height: 6px;
}

.gallery::-webkit-scrollbar-thumb {
    background-color: var(--genshin-gold);
    border-radius: 10px;
}

.gallery img {
    /* padding: 5px; */
    height: 180px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: transform 0.3s, border-color 0.3s;
    cursor: pointer;
}

.gallery img:hover {
    transform: scale(1.05);
    border-color: var(--genshin-gold);
}

/* --- Wanderer Peeking Effect --- */
.wanderer-body {
    position: absolute;
    top: -40px;
    right: -80px;
    height: 400px;
    z-index: 1;
    /* Sits behind the card (z-index 5) */
    pointer-events: none;
    user-select: none;
}

.wanderer-hand {
    position: absolute;
    top: 53.5px;
    right: -41px;
    width: 54px;
    z-index: 10;
    /* Sits on top of the card (z-index 5) */
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(-5px 5px 6px rgba(0, 0, 0, 0.6));
}

/* Hide on mobile */
@media (max-width: 1024px) {

    .wanderer-body,
    .wanderer-hand {
        display: none;
    }
}

/* --- Ayaka GIF Styling --- */
.about-card {
    position: relative;
    /* Anchors the absolute positioning of the GIF to this card */
}

.ayaka-gif {
    position: absolute;
    top: -45px;
    /* Pulls her up slightly over the border */
    right: 15px;
    width: 110px;
    /* Adjust scale as needed */
    z-index: 10;
    pointer-events: none;
    /* Ensures she doesn't block you from highlighting text underneath */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    /* Adds depth */
}

/* Mobile Adjustments for the GIF */
@media (max-width: 768px) {
    .ayaka-gif {
        width: 85px;
        top: -35px;
        right: 10px;
    }
}

.skill {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    margin: 0.4rem;
    border-radius: 999px;
    background: var(--genshin-glass);
    border: 1px solid rgba(211, 188, 142, 0.2);
    backdrop-filter: blur(4px);
    font-size: 0.95rem;
}

#skills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* 7. Highlights Section & Orbs */
#highlights-section {
    position: relative;
    padding: 2rem 2rem;
    margin: 2rem 0;
    background: linear-gradient(180deg, rgba(30, 35, 50, 0.3) 0%, rgba(43, 51, 68, 0.7) 50%, rgba(30, 35, 50, 0.3) 100%);
    border-top: 1px solid rgba(211, 188, 142, 0.3);
    border-bottom: 1px solid rgba(211, 188, 142, 0.3);
    border-radius: 24px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.4), 0 15px 35px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    backdrop-filter: blur(8px);
}
/* Decorative Heading */
#highlights-section h2 {
    position: relative;
    text-align: center;
    border-bottom: none; /* Remove default underline */
    margin-bottom: 0.2rem;
    font-size: 2.2rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--genshin-light);
    text-shadow: 0 0 20px rgba(211, 188, 142, 0.6);
}

/* Glowing stars next to the heading */
#highlights-section h2::before,
#highlights-section h2::after {
    content: '✦';
    font-size: 1.5rem;
    color: var(--genshin-gold);
    text-shadow: 0 0 15px var(--genshin-gold-glow);
    opacity: 0.9;
}

/* Elegant diamond divider below the heading */
.highlights-divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--genshin-gold), transparent);
    margin: 0 auto 2rem auto;
    position: relative;
    z-index: 1;
}

.highlights-divider::after {
    content: '♦';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--genshin-gold);
    font-size: 1rem;
    text-shadow: 0 0 10px var(--genshin-gold-glow);
    background-color: transparent;
}

.highlight-image-container {
    height: 200px;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid rgba(211, 188, 142, 0.1);
}

.highlight-image {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    transition: transform 0.6s ease;
}

.highlight-title {
    font-size: 1.4rem;
    color: var(--genshin-gold);
    text-shadow: 0 0 15px rgba(211, 188, 142, 0.4);
    margin: 0 0 0.5rem 0;
    transition: color 0.3s, text-shadow 0.3s;
}

.highlight-card:hover .highlight-title {
    color: #fff;
    text-shadow: 0 0 20px var(--genshin-gold);
}

.highlight-date {
    font-size: 0.85rem;
    color: #a0a8b8;
    margin-bottom: 1.5rem;
}

/* ===================================== */
/* --- Ambient Floating Orbs --- */
/* ===================================== */
.ambient-orbs-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0; /* Keeps it behind the cards */
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    /* Greatly increased opacity so it punches through the dark theme */
    background: radial-gradient(circle, rgba(211, 188, 142, 0.6) 0%, rgba(211, 188, 142, 0.35) 40%, transparent 70%);
    /* Reduced blur so the core remains visible */
    filter: blur(20px);
    mix-blend-mode: screen; /* Helps the light colors "glow" over the dark background */
}

/* Orb 1: Large, starts top-left */
.orb-1 {
    width: 400px;
    height: 400px;
    top: -10%;
    left: -10%;
    animation: floatOrb1 25s ease-in-out infinite alternate;
}

/* Orb 2: Medium, starts bottom-right */
.orb-2 {
    width: 300px;
    height: 300px;
    bottom: -20%;
    right: -10%;
    animation: floatOrb2 22s ease-in-out infinite alternate-reverse;
}

/* Orb 3: Small, starts in the middle */
.orb-3 {
    width: 250px;
    height: 250px;
    top: 40%;
    left: 30%;
    animation: floatOrb3 18s ease-in-out infinite alternate;
}

/* Random drift paths for each orb */
@keyframes floatOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(250px, 150px) scale(1.2); }
    66% { transform: translate(100px, 350px) scale(0.9); }
    100% { transform: translate(450px, 50px) scale(1.1); }
}

@keyframes floatOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-200px, -250px) scale(1.3); }
    66% { transform: translate(-450px, 50px) scale(0.8); }
    100% { transform: translate(-100px, -350px) scale(1); }
}

@keyframes floatOrb3 {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(250px, -150px) scale(1.1); }
    66% { transform: translate(-150px, -100px) scale(1.4); }
    100% { transform: translate(150px, 200px) scale(0.9); }
}

/* Ensure the grid and cards sit above the rotating background */
.highlights-grid {
    position: relative;
    z-index: 1;
    /* ...keep your existing .highlights-grid styles below this... */
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.highlight-card {
    position: relative;
    background: linear-gradient(145deg, rgba(43, 51, 68, 0.8), rgba(30, 35, 50, 0.95));
    border: 1px solid rgba(211, 188, 142, 0.2);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Bouncy transition for popping effect */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.highlight-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--genshin-gold);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(211, 188, 142, 0.3);
}

/* Image zooms and slightly tilts on hover */
.highlight-card:hover .highlight-image {
    transform: scale(1.1) rotate(1deg);
}

/* Smooth gradient so the image fades into the card body */
.highlight-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30, 35, 50, 1) 0%, rgba(30, 35, 50, 0.2) 50%, transparent 100%);
    pointer-events: none;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #d3bc8e, #a88d55);
    color: var(--genshin-dark);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 2;
    text-transform: uppercase;
}

.highlight-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

/* Fancy sweep button */
.view-project-btn {
    margin-top: auto;
    align-self: flex-start;
    background: transparent;
    color: var(--genshin-gold);
    border: 2px solid var(--genshin-gold);
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: box-shadow 0.3s ease;
}

.view-project-btn span {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

/* Background fill sweeping animation */
.view-project-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--genshin-gold);
    z-index: 0;
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    transform: scaleX(0);
    transform-origin: right;
}

/* Trigger button animation when hovering anywhere on the card */
.highlight-card:hover .view-project-btn::before,
.view-project-btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.highlight-card:hover .view-project-btn span,
.view-project-btn:hover span {
    color: var(--genshin-dark);
}

.highlight-card:hover .view-project-btn {
    box-shadow: 0 0 15px var(--genshin-gold-glow);
}
/* ================================================= */

/* 8. Modals (Images & 3D Viewer) */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 35, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    z-index: 1000;
}

.modal.visible {
    display: flex;
}

.modal-viewer {
    width: min(80vw, 900px);
    height: min(60vh, 80vh);
    /* width: auto;
    height: auto; */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zoom-controls {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--genshin-light);
}

.modal-content {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    /* box-shadow: 20px 20px 30px 0px rgba(0, 0, 0, 0.9); */
    transform-origin: center center;
    user-select: none;
    touch-action: none;
    /* border: 2px solid var(--genshin-gold); */
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--genshin-light);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--genshin-gold);
}

.stl-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(211, 188, 142, 0.3);
}

.view-stl-btn {
    background: transparent;
    color: var(--genshin-gold);
    border: 1px solid var(--genshin-gold);
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.view-stl-btn span {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.view-stl-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--genshin-gold);
    z-index: 0;
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    transform: scaleX(0);
    transform-origin: right;
}

.view-stl-btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.view-stl-btn:hover span {
    color: var(--genshin-dark);
}

.view-stl-btn:hover {
    box-shadow: 0 0 10px var(--genshin-gold-glow);
}
/* --- STL Modal Adjustments --- */
.stl-modal-viewer {
    width: min(90vw, 1000px);
    height: min(70vh, 800px);
    background-color: var(--genshin-dark);
    border: 2px solid rgba(211, 188, 142, 0.3);
    border-radius: 12px;
    position: relative;
}

.stl-loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--genshin-gold);
    font-size: 1.2rem;
    text-shadow: 0 0 10px var(--genshin-gold-glow);
    pointer-events: none;
}
/* --- STL Viewer Container --- */
.stl-container {
    position: relative;
    height: 180px;
    min-width: 250px;
    border-radius: 8px;
    border: 2px solid transparent;
    background-color: rgba(30, 35, 50, 0.6);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.stl-container:active {
    cursor: grabbing;
}

.stl-container:hover {
    border-color: var(--genshin-gold);
    transform: scale(1.02);
}

.stl-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(43, 51, 68, 0.85);
    color: var(--genshin-gold);
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    border: 1px solid var(--genshin-gold);
    pointer-events: none; /* Allows mouse interactions to pass through to the 3D canvas */
    z-index: 10;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}


/* 9. Media Queries (Mobile Adjustments) */
#credits_phone {
    display: none;
}
/* Mobile Adjustments */
@media (max-width: 768px) {
    .tabs-container {
        padding: 0.5rem;
        /* Make the container span the viewport so inner tabs can scroll freely */
        left: 0;
        transform: none;
        width: 100%;
        box-sizing: border-box;
    }

    .tab-button {
        padding: 0.5rem 1.2rem;
        font-size: 0.95rem;
    }

    /* Ensure the tabs start at the left and have horizontal padding for comfortable swipe */
    .tabs {
        justify-content: flex-start;
        padding: 15px 12px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .card-header {
        flex-direction: column;
        gap: 0.2rem;
    }

    #credits_phone {
        display: block;
    }
}

@media (max-width: 768px) {
    .tabs-container {
        /* Remove side padding on mobile so arrows can dock strictly to the edges */
        padding: 0.5rem 0;
    }

    .tabs {
        /* Add extra horizontal padding inside the scroll area so the first and last tabs aren't hidden under the arrows */
        padding: 10px 40px;
    }

    .scroll-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        bottom: 0;
        width: 40px;
        color: var(--genshin-gold);
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 10;
        transition: opacity 0.3s ease, color 0.2s;
    }

    .scroll-arrow:hover {
        color: var(--genshin-light);
    }

    /* Apply a gradient background matching your glass theme to hide tabs sliding underneath */
    .left-arrow {
        left: 0;
        background: linear-gradient(to right, rgba(30, 35, 50, 0.95) 40%, transparent);
    }

    .right-arrow {
        right: 0;
        background: linear-gradient(to left, rgba(30, 35, 50, 0.95) 40%, transparent);
    }

    /* Used by JS to hide arrows when fully scrolled */
    .scroll-arrow.hidden {
        opacity: 0;
        pointer-events: none;
    }

}

/* Scrolled State (Middle Right, Vertical) */
/* We only apply this to larger screens so it doesn't break mobile layouts */
@media (min-width: 769px) {

    .tabs-container.scrolled {
        top: 50%;
        left: calc(100% - 1.5rem);
        transform: translate(-100%, -50%);
        /* Reduced padding here as well */
        padding: 0.5rem 0;
        border-radius: 16px;
        background: rgba(30, 35, 50, 0.4);
        border-color: rgba(211, 188, 142, 0.15);
        scrollbar-width: thin;
    }

    .tabs-container.scrolled .tabs {
        flex-direction: column;
        /* Swapped the padding to give horizontal room for the glow when the buttons are stacked */
        padding: 10px 15px;
    }

    .tabs-container.scrolled .tab-button {
        padding: 0.6rem 1rem;
    }
}
