/* 公共样式 - 视频播放器、图片画廊、加载器等组件 */

/* 过渡动画 */
.transition-custom {
    transition: all 0.3s ease;
}

/* 楼层标签 */
.floor-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #FF7A00;
    color: white;
    font-size: 0.875rem;
    padding: 4px 12px;
    border-radius: 9999px;
    z-index: 30;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    pointer-events: none;
}

/* 视频容器 */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.video-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    z-index: 20;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 122, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.video-play-button:hover {
    background: rgba(255, 122, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-button i {
    color: white;
    font-size: 22px;
    margin-left: 3px;
}

.video-loading {
    position: absolute;
    inset: 0;
    z-index: 9999;
    display: none;
    background: rgba(0,0,0,.25);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.video-loading-text {
    margin-top: 10px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
    background: rgba(0,0,0,.55);
    padding: 4px 10px;
    border-radius: 999px;
}

.video-container.loading .video-play-button {
    opacity: 0;
    pointer-events: none;
}

.video-container.playing .video-cover,
.video-container.playing .video-play-button {
    opacity: 0;
    pointer-events: none;
}

.video-container.playing .video-player {
    display: block;
}

/* 视频不存在提示 */
.video-not-found {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    color: white;
    text-align: center;
    padding: 20px;
    transition: opacity 0.5s ease;
}

/* 下载状态提示 */
.download-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 40;
    display: none;
}

/* 图片分类标签 */
.image-category-label {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 122, 0, 0.92);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* 单张图片查看器 */
.single-image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.single-image-viewer.active {
    opacity: 1;
    visibility: visible;
}

.single-image-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-image-viewer img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.single-image-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 61;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.single-image-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.single-image-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 16px;
}

.single-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 36px;
    cursor: pointer;
    z-index: 61;
    opacity: 0.7;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-image-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.single-image-prev { left: 20px; }
.single-image-next { right: 20px; }

/* 加载指示器 */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF7A00;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 缓存状态指示器 */
.cache-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 100;
    display: none;
    backdrop-filter: blur(4px);
}

/* 按钮悬停效果 */
.view-images-btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.3);
}

.view-images-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.4);
}

.download-btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* 卡片悬停 */
.room-card {
    transition: all 0.3s ease;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .video-container {
        height: 200px !important;
    }

    .single-image-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .single-image-prev { left: 10px; }
    .single-image-next { right: 10px; }
}
