/* ==========================================
   sleepyDog - UI 樣式表 (終極穩定版)
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@700&display=swap');

:root {
    --font-main: 'Fira Code', monospace;
    --text-primary: #ffffff;
    --text-secondary: #b5bac1;
    --text-muted: #888888;
    --color-spotify: #1ed760;
    --status-online: #23a559;
    --status-idle: #f0b232;
    --status-dnd: #f23f43;
    --status-offline: #80848e;
    
    --glass-bg-light: rgba(255, 255, 255, 0.05);
    --glass-bg-dark: rgba(0, 0, 0, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-bar: rgba(15, 15, 15, 0.123);
    --glass-blur-heavy: blur(10px);
    --glass-blur-light: blur(0.5px);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: var(--font-main); 
}

body {
    background-color: #050505; 
    min-height: 100vh;
    display: flex; 
    justify-content: center; 
    align-items: center;
    color: var(--text-primary);
    overflow: hidden; 
}

/* ==========================================
   背景與轉場層級設定
   ========================================== */

/* 🌟 過渡黑幕：一開始放在狗的後面 */
#black-bg {
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: #050505; 
    z-index: 99997; 
    transition: opacity 1s ease; 
    pointer-events: none;
}

/* 🌟 3D 物理沙盒畫布：開場時放在最前面展示漂浮，點擊後 z-index 會用 JS 退後 */
#bg-3d-canvas {
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    pointer-events: auto; /* 讓滑鼠可以抓狗 */
    z-index: 99998; 
}

/* 背景影片 */
.bg-video {
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh; 
    object-fit: cover; 
    z-index: -2; 
    filter: brightness(0.6);
}

/* ==========================================
   進入畫面 (Glitch 特效)
   ========================================== */
.enter-screen {
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    z-index: 99999; 
    display: flex; 
    justify-content: center; 
    background: transparent;
    align-items: center; 
    cursor: pointer; 
    transition: opacity 1s ease;
}

.enter-screen.hidden { 
    opacity: 0; 
    pointer-events: none; 
}

.glitch-text { 
    font-size: 24px; 
    font-weight: bold; 
    color: white; 
    position: relative; 
    letter-spacing: 5px; 
    animation: glitch-anim 2s infinite; 
}

.glitch-text::before, .glitch-text::after { 
    content: attr(data-text); 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: transparent; 
}

.glitch-text::before { 
    left: 2px; 
    text-shadow: -2px 0 #ff00c1; 
    animation: glitch-anim-2 3s infinite linear alternate-reverse; 
}

.glitch-text::after { 
    left: -2px; 
    text-shadow: -2px 0 #00fff9; 
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse; 
}

@keyframes glitch-anim-1 { 0% { clip-path: inset(20% 0 80% 0); } 100% { clip-path: inset(30% 0 20% 0); } }
@keyframes glitch-anim-2 { 0% { clip-path: inset(10% 0 60% 0); } 100% { clip-path: inset(5% 0 80% 0); } }

/* ==========================================
   共用 UI 元素
   ========================================== */

.glass-panel {
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
    border: 1px solid var(--glass-border);
}

.linux-bar {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 28px;
    background: var(--glass-bar); 
    backdrop-filter: var(--glass-blur-heavy);
    border-bottom: 1px solid var(--glass-border); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 15px;
    font-size: 12px; 
    color: #ccc; 
    z-index: 9000;
}

.linux-left, .linux-right { display: flex; gap: 15px; align-items: center; }
.linux-item { display: flex; align-items: center; gap: 5px; }
.linux-icon { color: var(--text-muted); font-weight: bold; }
.bar-btn { cursor: pointer; transition: 0.2s; }
.bar-btn:hover { color: white; text-shadow: 0 0 5px rgba(255,255,255,0.5); }

.bar-dropdown-container { position: relative; }
.bar-dropdown {
    position: absolute; 
    top: 28px; 
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: var(--glass-blur-heavy); 
    border: 1px solid var(--glass-border);
    border-radius: 0 0 8px 8px; 
    padding: 10px; 
    opacity: 0; 
    visibility: hidden;
    transition: all 0.3s ease; 
    transform: translateY(-10px); 
    z-index: 10000;
}
.bar-dropdown-container:hover .bar-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.spotify-drop { left: 0; display: flex; gap: 10px; width: 200px; }
.weather-drop { right: 0; width: 180px; text-align: center; }
.calendar-drop { right: 0; width: 220px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 5px; }
.cal-day { font-size: 10px; padding: 3px; border-radius: 3px; }
.cal-today { background: rgba(255,255,255,0.2); color: white; font-weight: bold; }

/* ==========================================
   中央主機板與內容
   ========================================== */

.main-board {
    position: relative; 
    z-index: 10; 
    width: 650px; 
    max-width: 95vw; 
    padding: 30px;
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.board-header { text-align: left; margin-bottom: 10px; }
.main-title { font-size: 32px; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.sub-title { font-size: 14px; color: #ccc; margin-top: 5px; }

.activity-row { display: flex; flex-wrap: wrap; gap: 15px; }
.act-card {
    background: var(--glass-bg-dark); 
    border: 1px solid var(--glass-border);
    padding: 12px 20px 12px 12px; 
    display: flex; 
    align-items: center;
    transform: translateZ(20px); 
    transform-style: preserve-3d; 
    flex: 1; 
    min-width: 250px;
}

.avatar-wrapper { position: relative; margin-right: 15px; }
.d-avatar { width: 60px; height: 60px; object-fit: cover; border-radius: 50%; border: 2px solid #2b2d31; }
.act-img { width: 60px; height: 60px; object-fit: cover; margin-right: 15px; }

.status-dot { position: absolute; bottom: 0px; right: 0px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #2b2d31; }
.online { background-color: var(--status-online); }
.idle { background-color: var(--status-idle); }
.dnd { background-color: var(--status-dnd); }
.offline { background-color: var(--status-offline); }

.act-info { text-align: left; }
.act-name { font-size: 18px; font-weight: bold; color: #f2f3f5; margin-bottom: 4px; }
.act-details { font-size: 13px; color: var(--text-secondary); }

/* 下拉連結選單 */
.links-dropdown { width: 100%; margin-top: 10px; }
.dropdown-toggle {
    width: 100%; 
    background: transparent; 
    color: var(--text-primary); 
    border: 1px solid transparent; 
    padding: 15px; 
    font-size: 16px; 
    font-weight: bold; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    transition: all 0.3s ease;
}
.dropdown-toggle:hover { background: var(--glass-bg-light); }

.dropdown-content { 
    max-height: 0; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: max-height 0.4s ease-in-out, margin-top 0.4s ease; 
    gap: 10px; 
    margin-top: 0; 
}
.dropdown-content.show { max-height: 500px; margin-top: 15px; }

.social-btn { 
    display: flex; 
    align-items: center; 
    background: var(--glass-bg-light); 
    border: 1px solid var(--glass-border); 
    padding: 12px 15px; 
    color: #ddd; 
    text-decoration: none; 
    transition: all 0.3s ease; 
}
.social-btn:hover { 
    background: rgba(255, 255, 255, 0.15); 
    transform: translateX(10px); 
    color: var(--text-primary); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
}
.btn-gif { width: 24px; height: 24px; margin-right: 15px; object-fit: cover; }
.arrow { transition: transform 0.3s ease; }
.arrow.rotate { transform: rotate(180deg); }

/* ==========================================
   果凍視窗與互動模組
   ========================================== */

.jelly-widget {
    position: fixed; 
    z-index: 1000; 
    cursor: grab;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    transition: transform 0.5s cubic-bezier(0.25, 1.5, 0.5, 1); 
}
.jelly-widget:active { cursor: grabbing; }

.drag-handle { 
    background: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(5px); 
    color: var(--text-primary); 
    text-align: center; 
    font-size: 12px; 
    padding: 4px; 
    user-select: none; 
    border-radius: 8px 8px 0 0; 
}

#custom-music-player { 
    bottom: 20px; 
    left: 20px; 
    width: 320px; 
    padding: 15px; 
    border-radius: 12px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}
#draggable-spotify { bottom: 20px; right: 20px; width: 300px; opacity: 0.85; }
#draggable-spotify iframe { opacity: 1; border-radius: 0 0 12px 12px; }

/* 視窗關閉按鈕 */
.close-btn { 
    float: right; 
    color: #ff5f56; 
    font-size: 14px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: transform 0.2s; 
}
.close-btn:hover { transform: scale(1.3); }

/* 音樂播放器內部 */
.player-info { text-align: center; }
.player-title { font-weight: bold; font-size: 16px; color: var(--text-primary); }
.player-artist { font-size: 12px; color: var(--text-secondary); }
.player-controls { display: flex; justify-content: center; gap: 20px; }
.ctrl-btn { background: none; border: none; color: white; font-size: 20px; cursor: pointer; transition: transform 0.2s;}
.ctrl-btn:hover { transform: scale(1.2); color: var(--color-spotify); }
.progress-container, .volume-container { display: flex; align-items: center; gap: 10px; font-size: 12px; }
input[type=range] { flex: 1; cursor: pointer; accent-color: var(--color-spotify); }