/**
 * 播放器样式文件
 * 全屏媒体播放器专用样式
 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

/* 播放器容器 */
.player-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 媒体显示区域 */
.media-display {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* 媒体项通用样式 */
.media-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.media-item.active {
    opacity: 1;
    z-index: 2;
}

/* 图片样式 */
.media-item.image {
    object-fit: cover;
    object-position: center;
}

/* 视频样式 */
.media-item.video {
    object-fit: contain;
    object-position: center;
}

/* URL框架样式 */
.url-frame {
    border: none;
    background: #fff;
    width: 100%;
    height: 100%;
}

/* 错误消息 */
.error-message {
    color: #ff6b6b;
    text-align: center;
    padding: 50px;
    font-size: 24px;
    background: rgba(0,0,0,0.8);
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.error-message h2 {
    margin-bottom: 20px;
    font-size: 32px;
}

.error-message p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.error-message small {
    font-size: 16px;
    opacity: 0.8;
}

/* 加载消息 */
.loading-message {
    color: #4ecdc4;
    text-align: center;
    padding: 50px;
    font-size: 24px;
    background: rgba(0,0,0,0.8);
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.loading-message::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #4ecdc4;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* 空播放列表 */
.empty-playlist {
    color: #ffd93d;
    text-align: center;
    padding: 50px;
    font-size: 24px;
    background: rgba(0,0,0,0.8);
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.empty-playlist h2 {
    margin-bottom: 20px;
    font-size: 32px;
}

.empty-playlist p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.empty-playlist small {
    font-size: 16px;
    opacity: 0.8;
}

/* 播放器信息面板 */
.player-info {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.player-info.show {
    opacity: 1;
}

.player-info div {
    margin-bottom: 5px;
    line-height: 1.4;
}

.player-info div:last-child {
    margin-bottom: 0;
}

/* 进度条 */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    z-index: 1000;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-20px); }
    100% { transform: translateX(20px); }
}

/* 媒体标题 */
.media-title {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-title.show {
    opacity: 1;
}

/* 控制提示 */
.control-hints {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.control-hints.show {
    opacity: 1;
}

.control-hints div {
    margin-bottom: 3px;
    line-height: 1.3;
}

.control-hints div:last-child {
    margin-bottom: 0;
}

.control-hints kbd {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
}

/* 状态指示器 */
.status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 1000;
    animation: pulse 2s infinite;
}

.status-indicator.playing {
    background: #4caf50;
}

.status-indicator.paused {
    background: #ff9800;
}

.status-indicator.error {
    background: #f44336;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* 缓冲指示器 */
.buffer-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.buffer-indicator.show {
    opacity: 1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 音量指示器 */
.volume-indicator {
    position: fixed;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 20px 15px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.volume-indicator.show {
    opacity: 1;
}

.volume-bar {
    width: 4px;
    height: 100px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    position: relative;
    margin: 10px auto;
}

.volume-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #007bff;
    border-radius: 2px;
    transition: height 0.2s ease;
}

/* 全屏过渡效果 */
.fullscreen-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fullscreen-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* 媒体切换动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

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

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

/* 媒体切换效果类 */
.media-item.slide-in {
    animation: slideInRight 0.5s ease-out;
}

.media-item.slide-out {
    animation: slideOutLeft 0.5s ease-out;
}

.media-item.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.media-item.fade-out {
    animation: fadeOut 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .player-info {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .media-title {
        bottom: 20px;
        left: 10px;
        right: 10px;
        transform: none;
        font-size: 16px;
        padding: 10px 20px;
        max-width: calc(100% - 20px);
    }
    
    .control-hints {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .error-message,
    .loading-message,
    .empty-playlist {
        padding: 30px 20px;
        font-size: 18px;
        margin: 20px;
    }
    
    .error-message h2,
    .empty-playlist h2 {
        font-size: 24px;
    }
    
    /* 确保媒体内容在移动端正确显示 */
    .media-item.image {
        object-fit: contain;
    }
    
    .media-item.video {
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .player-info {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .media-title {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .progress-bar {
        height: 3px;
    }
    
    .error-message,
    .loading-message,
    .empty-playlist {
        font-size: 16px;
        padding: 20px 15px;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .player-info,
    .media-title,
    .control-hints {
        background: rgba(0,0,0,0.95);
        border: 2px solid #fff;
    }
    
    .progress-fill {
        background: #fff;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .media-item,
    .player-info,
    .media-title,
    .control-hints,
    .progress-fill {
        transition: none;
    }
    
    .media-item.slide-in,
    .media-item.slide-out,
    .media-item.fade-in,
    .media-item.fade-out {
        animation: none;
    }
    
    .spinner,
    .loading-message::after {
        animation: none;
    }
}

/* 打印样式 */
@media print {
    .player-container {
        background: #fff;
        color: #000;
    }
    
    .player-info,
    .progress-bar,
    .media-title,
    .control-hints,
    .status-indicator {
        display: none;
    }
    
    .media-item.image {
        object-fit: contain;
        max-width: 100%;
        max-height: 100%;
    }
    
    .media-item.video,
    .url-frame {
        display: none;
    }
}

/* 自定义滚动条（如果需要） */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* 选择文本样式 */
::selection {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

::-moz-selection {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* 焦点样式 */
*:focus {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

/* 隐藏默认控件 */
video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* 禁用右键菜单 */
.media-item {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* 禁用拖拽 */
img, video {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}