/**
 * 沉浸式互动旅行体验 - 自定义样式
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 禁用橡皮筋效果和滚动条 */
html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: none;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* 页面主体鼠标样式 */
body {
    cursor: ns-resize; /* 上下拖拽指示器 */
}

/* 特定元素的鼠标样式 */
.interactive-element, 
.close-moment, 
.restart-journey,
.swipe-container,
.chapter-1-start-button {
    cursor: pointer !important; /* 确保交互元素显示为手指指针 */
}

/* 鼠标拖拽状态 */
body.dragging {
    cursor: grabbing !important;
}

/* 向上箭头提示样式 */
.upward-arrow-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInOut 2s infinite alternate;
    z-index: 10;
}

@keyframes fadeInOut {
    0% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* 瞬间容器样式 */
.moment-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    opacity: 0;
    background-color: rgba(0, 0, 0, 0.7); /* 添加半透明背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer; /* 提示用户可以点击 */
    transition: background-color 0.2s ease; /* 添加背景色过渡 */
}

/* 鼠标悬停时稍微改变背景色，提示可点击性 */
.moment-container:hover {
    background-color: rgba(0, 0, 0, 0.75);
}

/* 瞬间内容容器 */
.moment-content-wrapper {
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    cursor: default; /* 内容区域使用默认鼠标样式 */
    position: relative;
    z-index: 51;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); /* 添加阴影增强视觉分离 */
    border-radius: 8px;
}

/* Gallery类型瞬间的特殊样式 */
#moment-5-1 .p-6.max-w-7xl {
    max-width: 95%;
    max-height: 90vh;
    width: 1200px; /* 最大宽度更宽 */
    overflow-y: auto; /* 垂直可滚动 */
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 51;
    cursor: default;
}

/* Gallery中的grid布局样式 */
#moment-5-1 .grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    #moment-5-1 .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Gallery中的图片样式 */
#moment-5-1 .grid img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

#moment-5-1 .grid img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 分类标题样式 */
#moment-5-1 h4 {
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    position: relative;
    padding-left: 0.75rem;
    grid-column: 1 / -1;
}

#moment-5-1 h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25rem;
    bottom: 0.5rem;
    width: 3px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 3px;
}

/* 特大图片样式 */
#moment-5-1 .md\:col-span-2.md\:row-span-2 {
    grid-column: span 2;
    grid-row: span 2;
}

#moment-5-1 .aspect-square {
    aspect-ratio: 1 / 1;
    width: 100%;
}

/* 交互元素通用样式增强 */
.interactive-element {
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.3s ease;
    position: relative;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.interactive-element:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

/* 章节中的互动按钮通用增强 */
.interactive-grid .interactive-element {
    position: relative;
    overflow: visible;
}

/* 为圆形交互按钮添加特殊效果 */
.interactive-element.rounded-full::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: rotate-halo 10s linear infinite;
}

@keyframes rotate-halo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 添加互动元素微动效和闪烁光线 */
.interactive-element::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: inherit;
    z-index: -1;
    animation: pulse-border 2s infinite;
    opacity: 0;
}

.interactive-element:hover::after {
    opacity: 1;
}

/* 脉冲效果类 - 用于所有交互元素 */
.pulse-effect::after {
    opacity: 0.3; /* 默认可见但不太明显 */
}

.pulse-effect:hover::after {
    opacity: 0.8; /* 悬停时更明显 */
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* 首页"旅行的意义"按钮特殊处理 */
.travel-meaning-btn {
    position: relative;
    overflow: visible;
    animation: subtle-float 3s ease-in-out infinite;
}

.travel-meaning-btn::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: inherit;
    z-index: -1;
    animation: pulse-meaning 3s infinite;
    opacity: 0.6;
}

@keyframes subtle-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes pulse-meaning {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* 首页"点击开始旅程"按钮特殊处理 */
.chapter-1-start-button {
    transform-origin: center center;
}

.chapter-1-start-button:hover {
    transform: scale(1.05);
}

/* 长按互动元素 */
.longpress-element {
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

/* 滑动容器样式 */
.swipe-container {
    width: 100%;
    overflow: hidden;
    touch-action: pan-x;
}

.swipe-wrapper {
    display: flex;
    transition: transform 0.3s ease;
}

.swipe-slide {
    flex-shrink: 0;
    width: 100%;
}

/* 画廊导航箭头样式 */
.gallery-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.gallery-nav svg {
    stroke: white;
}

/* 城市摄影章节样式 */
.city-gallery-container {
    overflow: hidden !important; /* 强制确保内容不会溢出 */
    position: relative;
}

.city-gallery-container .swipe-slide {
    transition: transform 0.5s ease, opacity 0.5s ease;
    width: 100%; /* 确保每个滑动项都是100%宽度 */
    overflow: hidden; /* 确保内容不会溢出 */
    position: relative;
    flex: 0 0 100%; /* 强制每个滑动项占据完整宽度 */
}

.city-gallery-container .swipe-wrapper {
    will-change: transform;
    width: 100%; /* 确保包装器的宽度正确 */
    display: flex;
    position: relative;
}

.city-gallery-container .swipe-slide > div:first-child {
    transform: scale(1.05);
    transition: transform 0.8s ease-out;
    will-change: transform;
    width: 100%; /* 确保内部div也是100%宽度 */
}

.city-gallery-container .swipe-slide.active > div:first-child {
    transform: scale(1);
}

/* 滑动指示器动画 */
.swipe-indicator {
    transition: all 0.3s ease;
}

.swipe-indicator.active {
    transform: scale(1.2);
}

/* 移动设备上的画廊导航样式调整 */
@media (max-width: 768px) {
    .gallery-nav {
        padding: 12px;
    }
    
    .gallery-nav svg {
        width: 24px;
        height: 24px;
    }
}

/* 加载中动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    flex-direction: column;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.loading-progress {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 交互提示动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 拖拽指示器（已禁用） */
.drag-indicator {
    display: none !important;
}

.drag-indicator-up,
.drag-indicator-down {
    display: none !important;
}

/* 导航章节链接样式 */
.nav-chapter-link {
    white-space: nowrap;
    min-width: 150px;
}

/* 手势教程样式 */
.gesture-tutorial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer; /* 提示可点击 */
    transition: background-color 0.2s ease;
}

.gesture-tutorial:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.tutorial-content {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    cursor: default; /* 内容区域用默认鼠标样式 */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.tutorial-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.tutorial-step {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tutorial-step p {
    font-size: 16px;
    color: white;
    text-align: left;
}

.gesture-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.swipe-up-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-left: 3px solid white;
    border-top: 3px solid white;
    top: 22px;
    left: 18px;
    transform: rotate(45deg);
    animation: swipeUpDown 2s infinite;
}

.tap-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    top: 18px;
    left: 18px;
    animation: tap 2s infinite;
}

.swipe-side-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-left: 3px solid white;
    border-top: 3px solid white;
    top: 18px;
    left: 18px;
    transform: rotate(-45deg);
    animation: swipeSide 2s infinite;
}

.tutorial-close {
    background-color: white;
    color: black;
    border: none;
    border-radius: 24px;
    padding: 10px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tutorial-close:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

@keyframes swipeUpDown {
    0%, 100% {
        transform: rotate(45deg) translate(0, 0);
    }
    50% {
        transform: rotate(45deg) translate(0, -10px);
    }
}

@keyframes tap {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
    }
}

@keyframes swipeSide {
    0%, 100% {
        transform: rotate(-45deg) translate(0, 0);
    }
    50% {
        transform: rotate(-45deg) translate(-10px, 0);
    }
}

.tap-outside-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    top: 18px;
    left: 18px;
    animation: tapOutside 2s infinite;
}

@keyframes tapOutside {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* 自定义旅行章节样式 */
.custom-route-content {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    width: 100%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .custom-route-content {
        max-height: 70vh;
        padding: 12px;
    }
}

.chapters-list {
    margin-bottom: 16px;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chapter-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chapter-item.selected {
    background-color: rgba(255, 255, 255, 0.25);
    border-left: 3px solid rgba(255, 255, 255, 0.8);
}

.chapter-item-checkbox {
    margin-right: 10px;
    min-width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.chapter-item-title {
    font-size: 14px;
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 768px) {
    .chapter-item {
        padding: 6px 8px;
    }
    
    .chapter-item-checkbox {
        min-width: 16px;
        height: 16px;
    }
}

.chapter-item.selected .chapter-item-checkbox {
    background-color: rgba(255, 255, 255, 0.8);
}

.chapter-item.selected .chapter-item-checkbox::after {
    content: '✓';
    color: rgba(0, 0, 0, 0.8);
    font-size: 12px;
    font-weight: bold;
}

.selected-chapters {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 16px;
}

.selected-chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 4px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 14px;
}

.remove-chapter {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    transition: color 0.2s ease;
    padding: 0 6px;
}

.remove-chapter:hover {
    color: rgba(255, 255, 255, 0.9);
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .modal-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

.cancel-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.cancel-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.submit-btn {
    background-color: rgba(255, 255, 255, 0.8);
    color: rgba(0, 0, 0, 0.8);
}

.submit-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* 脉冲边框效果 - 用于"重新开始"按钮 */
@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.pulse-border-effect {
    position: relative;
    border-radius: 0.375rem;
    animation: pulse-border 2s infinite;
    transition: all 0.3s ease;
}

.pulse-border-effect:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* 导航提示样式优化 */
#navigation-hints {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    width: 100%;
}

/* 站点提示样式 */
#navigation-hints .text-xs {
    margin-top: 6px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
} 