:root {
    --bg-main: #07080a;
    --bg-card: rgba(18, 20, 26, 0.75);
    --bg-card-hover: rgba(28, 32, 42, 0.85);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.35);
    --accent-hover: #7c3aed;
    --discord-color: #5865F2;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.06);
    --radius-lg: 24px;
    --radius-md: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

/* Sarok váltó gomb */
.corner-mode-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 10000;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.corner-mode-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- WINDOWS 98 TÉMA --- */
body.win98-mode {
    background-color: #008080 !important;
    background-image: url('background.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    font-family: 'MS Sans Serif', Tahoma, sans-serif !important;
    color: #000000 !important;
}
body.win98-mode .bg-glow { display: none !important; }
body.win98-mode .corner-mode-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    color: #000;
    border-radius: 0;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
}

body.win98-mode .win98-window {
    background: #c0c0c0 !important;
    border: 2px solid !important;
    border-color: #ffffff #808080 #808080 #ffffff !important;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.5) !important;
    backdrop-filter: none !important;
    border-radius: 0 !important;
    position: absolute !important;
    width: auto !important;
    height: auto !important;
    touch-action: none;
}

body.win98-mode .view-section {
    display: block !important;
    position: relative;
    width: 100%;
    height: 100%;
}

body.win98-mode .win98-titlebar { display: flex !important; }
body.win98-mode .win98-taskbar-top { display: flex !important; }
body.win98-mode .bottom-player-bar {
    background: #c0c0c0 !important;
    border-top: 3px solid #ffffff !important;
}
body.win98-mode .ctrl-btn, body.win98-mode .filter-btn {
    background: #c0c0c0 !important;
    border: 2px solid !important;
    border-color: #ffffff #808080 #808080 #ffffff !important;
    color: #000 !important;
    border-radius: 0 !important;
}

/* Win98 mód szövegek kifehérítése helyett feketére/sötétre állítása */
body.win98-mode h1, 
body.win98-mode h2, 
body.win98-mode span, 
body.win98-mode p, 
body.win98-mode div,
body.win98-mode label,
body.win98-mode .logo-text,
body.win98-mode .track-details h1,
body.win98-mode .track-details p,
body.win98-mode .lyrics-header,
body.win98-mode .lyrics-content,
body.win98-mode .time-stamp,
body.win98-mode .volume-container {
    color: #000000 !important;
}
body.win98-mode .track-card .track-author,
body.win98-mode .track-card .track-name {
    color: #000000 !important;
}
body.win98-mode .track-card.active,
body.win98-mode .track-card.active * {
    color: #ffffff !important; /* Kiválasztott zenénél fehér marad a kontraszt miatt */
}

/* Modern háttér glentek */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}
.blob-1 { width: 500px; height: 500px; background: #6d28d9; top: -120px; left: -120px; }
.blob-2 { width: 550px; height: 550px; background: #db2777; bottom: -150px; right: -120px; }

/* Boot & Leállítás Képernyők */
.boot-screen, .shutdown-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    color: #fff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.boot-screen.hidden, .shutdown-screen.hidden { display: none !important; }
.bios-text { font-family: 'Courier New', Courier, monospace; font-size: 1.1rem; color: #ffdf00; line-height: 1.6; }
.win98-boot-logo { text-align: center; opacity: 0; transform: scale(.8); }
.win98-boot-logo.boot-reveal { animation: boot-reveal 5s cubic-bezier(.2,.75,.25,1) forwards; }
.win98-boot-logo h2 { margin-top: 16px; font: 700 clamp(1.8rem, 6vw, 3.5rem) Tahoma, sans-serif; letter-spacing: 1px; color: #fff; }
.win98-boot-logo p { margin-top: 8px; font: 500 clamp(1rem, 3vw, 1.5rem) Tahoma, sans-serif; color: #d7e9ff; letter-spacing: .08em; }
.boot-brand-mark { width: 74px; height: 74px; margin: auto; display:grid; place-items:center; background: linear-gradient(135deg,#ffb300,#f04438 45%,#1778d4 46%,#1b9b4b); color:#fff; font:bold 2.6rem Tahoma,sans-serif; transform: rotate(-8deg); box-shadow:0 8px 30px #1687ff66; }
@keyframes boot-reveal { 0% { opacity:0; transform:scale(.8); filter:blur(12px); } 70% { opacity:1; transform:scale(1.08); filter:blur(0); } 100% { opacity:1; transform:scale(1); filter:blur(0); } }
body.win98-mode .bios-text { color: #ffdf00 !important; }
body.win98-mode .win98-boot-logo h2 { color: #fff !important; }
body.win98-mode .win98-boot-logo p { color: #d7e9ff !important; }

.power-off-box { text-align: center; color: #fff; }
.power-btn-icon { font-size: 4rem; color: #ef4444; cursor: pointer; margin-bottom: 20px; transition: transform 0.2s; }
.power-btn-icon:hover { transform: scale(1.1); color: #f87171; }

/* Fő keret */
.app-container {
    width: 100%;
    max-width: 1350px;
    height: calc(100vh - 150px);
    max-height: 680px;
    position: relative;
    margin: auto auto;
    padding: 0 20px;
}

.view-section {
    display: grid;
    grid-template-columns: 340px 1fr 340px;
    gap: 18px;
    width: 100%;
    height: 100%;
}

.win98-window {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    transition: background 0.3s, border 0.3s, box-shadow 0.3s, border-radius 0.3s;
}
.win98-window.hidden { display: none !important; }

.win98-titlebar {
    display: none;
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #ffffff;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 0.85rem;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
}
body.win98-mode .win98-titlebar { display: flex !important; }

.win98-title-text { display: flex; align-items: center; gap: 6px; }
.win98-mini-icon { width: 14px; height: 14px; }
.win98-window-buttons { display: flex; gap: 2px; }

.win98-btn {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    width: 16px;
    height: 14px;
    font-size: 9px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
}

.win98-window-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    height: 100%;
}
body.win98-mode .win98-window-body { padding: 10px; height: calc(100% - 24px); }
.flex-col-body { height: 100%; }
body.win98-mode .flex-col-body { height: calc(100% - 24px); }
body.win98-mode .win98-window > .flex-col-body { min-height: 0; flex: 1 1 0; overflow: hidden; }

.brand-header { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; margin-bottom: 8px; }
.brand-clickable { display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.logo-text { font-weight: 700; font-size: 0.95rem; }

.nav-discord-btn {
    background: var(--discord-color);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
body.win98-mode .nav-discord-btn { border-radius: 0; border: 2px solid; border-color: #fff #404040 #404040 #fff; color: #000 !important; background: #c0c0c0; }

.now-playing-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin: auto 0; }
.cover-wrapper.large-cover { width: 220px; height: 220px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-color); }
body.win98-mode .cover-wrapper.large-cover { border-radius: 0; border: 2px solid; border-color: #808080 #fff #fff #808080; }
.cover-wrapper img { width: 100%; height: 100%; object-fit: cover; }

.track-details h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: 4px; color: #a1a1aa; }
body.win98-mode .track-details h1 { color: #000; }
.track-details p { font-size: 0.88rem; color: var(--text-secondary); }
body.win98-mode .track-details p { color: #333; }

.sidebar-header { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; margin-bottom: 8px; }
.sidebar-header h2 { font-size: 1.05rem; font-weight: 700; }
.category-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; flex-shrink: 0; }

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
body.win98-mode .filter-btn { border-radius: 0; background: #c0c0c0; color: #000; border: 2px solid; border-color: #fff #808080 #808080 #fff; }
body.win98-mode .filter-btn.active { background: #000080; color: #fff !important; }

.playlist-container { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 4px; flex: 1; min-height: 0; }
.track-card { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: var(--radius-md); cursor: pointer; flex-shrink: 0; }
body.win98-mode .track-card { border-radius: 0; }
.track-card:hover { background: var(--bg-card-hover); }
body.win98-mode .track-card:hover { background: rgba(0,0,128,0.1); }
.track-card.active { background: var(--bg-card-hover); border-color: rgba(139, 92, 246, 0.4); }
body.win98-mode .track-card.active { background: #000080 !important; color: #fff !important; }
body.win98-mode .track-card.active * { color: #fff !important; }

.track-card .track-img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; }
body.win98-mode .track-card .track-img { border-radius: 0; }
.track-card .track-info { flex: 1; overflow: hidden; }
.track-card .track-name { font-size: 0.85rem; font-weight: 500; color: #a1a1aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.win98-mode .track-card .track-name { color: #000; }
.track-card.active .track-name { color: #ffffff !important; }
.track-card .track-author { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
body.win98-mode .track-card .track-author { color: #333; }
.track-card.active .track-author { color: #ffffff !important; }

.track-card .play-icon { font-size: 0.78rem; color: var(--text-secondary); opacity: 0; }
.track-card:hover .play-icon, .track-card.active .play-icon { opacity: 1; color: var(--accent); }
body.win98-mode .track-card.active .play-icon { color: #fff !important; }

.og-badge { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; font-size: 0.58rem; font-weight: 800; padding: 2px 5px; border-radius: 4px; margin-left: 6px; }
body.win98-mode .og-badge { background: #ffcc00; color: #000; border-radius: 0; border: 1px solid #808080; }

.lyrics-header { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-bottom: 10px; }
.lyrics-content { font-size: 0.85rem; line-height: 1.55; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; padding-right: 6px; white-space: pre-line; }
body.win98-mode .playlist-container,
body.win98-mode .lyrics-content {
    scrollbar-width: auto;
    scrollbar-color: #c0c0c0 #808080;
}
body.win98-mode .playlist-container::-webkit-scrollbar,
body.win98-mode .lyrics-content::-webkit-scrollbar { width: 16px; }
body.win98-mode .playlist-container::-webkit-scrollbar-track,
body.win98-mode .lyrics-content::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #fff #fff #808080;
}
body.win98-mode .playlist-container::-webkit-scrollbar-thumb,
body.win98-mode .lyrics-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #404040 #404040 #fff;
}
body.win98-mode .playlist-container::-webkit-scrollbar-button,
body.win98-mode .lyrics-content::-webkit-scrollbar-button {
    display: block;
    height: 16px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #404040 #404040 #fff;
}
body.win98-mode .playlist-container::-webkit-scrollbar-button:single-button:vertical:decrement,
body.win98-mode .lyrics-content::-webkit-scrollbar-button:single-button:vertical:decrement {
    background: #c0c0c0 linear-gradient(135deg, transparent 50%, #000 50%) 5px 6px / 6px 6px no-repeat;
}
body.win98-mode .playlist-container::-webkit-scrollbar-button:single-button:vertical:increment,
body.win98-mode .lyrics-content::-webkit-scrollbar-button:single-button:vertical:increment {
    background: #c0c0c0 linear-gradient(-45deg, transparent 50%, #000 50%) 5px 4px / 6px 6px no-repeat;
}

/* TÁLCA ÉS START MENÜ */
.bottom-player-bar {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background: rgba(10, 11, 14, 0.95);
    backdrop-filter: blur(25px);
    border-top: 1px solid var(--border-color);
    padding: 8px 25px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 900;
}
body.win98-mode .bottom-player-bar {
    background: #c0c0c0 !important;
    border-top: 3px solid #ffffff !important;
    padding: 6px 15px !important;
}

.win98-taskbar-top { display: none; align-items: center; gap: 12px; font-size: 0.85rem; position: relative; }
body.win98-mode .win98-taskbar-top { display: flex !important; }

.win98-start-wrapper { position: relative; }
.win98-start-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 3px 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #000;
}

.win98-start-menu {
    position: absolute;
    bottom: 35px; left: 0;
    width: 240px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #404040 #404040 #ffffff;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.4);
    display: flex;
    z-index: 10000;
}
.win98-start-menu.hidden { display: none !important; }

.start-menu-side-banner {
    width: 25px;
    background: linear-gradient(180deg, #1084d0, #000080);
    color: #fff;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 8px 0;
}

.start-menu-items { flex: 1; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.start-item { padding: 6px 10px; font-size: 0.82rem; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 500; color: #000; }
.start-item:hover { background: #000080; color: #fff; }
.start-divider { height: 1px; background: #808080; border-bottom: 1px solid #fff; margin: 4px 0; }

.start-search-box { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #fff; border: 1px inset #808080; }
.start-search-box input { border: none; outline: none; font-size: 0.8rem; width: 100%; color: #000; }

.win98-taskbar-windows { display: none; gap: 4px; flex: 1; }
body.win98-mode .win98-taskbar-windows { display: flex !important; }
.taskbar-win-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #000;
}
.taskbar-win-btn.minimized { border-color: #808080 #ffffff #ffffff #808080; background: #b0b0b0; color: #444; }

.win98-tray-clock { display: none; border: 1px inset #808080; padding: 2px 8px; background: #c0c0c0; font-size: 0.78rem; color: #000; }
body.win98-mode .win98-tray-clock { display: block !important; }

.bottom-player-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1350px; margin: 0 auto; width: 100%; }
.progress-container { display: flex; align-items: center; gap: 12px; max-width: 1350px; margin: 0 auto; width: 100%; }
.time-stamp { font-size: 0.72rem; min-width: 35px; color: var(--text-secondary); }
body.win98-mode .time-stamp { color: #000; }

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}
body.win98-mode input[type="range"] { background: #808080; border: 1px solid #fff; border-radius: 0; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
body.win98-mode input[type="range"]::-webkit-slider-thumb {
    width: 12px; height: 18px; border-radius: 0; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff;
}

.buttons-container { display: flex; justify-content: center; align-items: center; gap: 12px; }
.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
body.win98-mode .ctrl-btn {
    background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff; border-radius: 0; color: #000; width: 30px; height: 30px;
}
.ctrl-btn.main-btn { background: var(--accent); color: #fff; width: 38px; height: 38px; border-radius: 50%; }
body.win98-mode .ctrl-btn.main-btn { background: #c0c0c0 !important; width: 36px; height: 36px; border-radius: 0; color: #000 !important; }

.volume-container { display: flex; align-items: center; gap: 8px; width: 170px; font-size: 0.78rem; color: var(--text-secondary); }
body.win98-mode .volume-container { color: #000; }

.toast {
  position: fixed; bottom: 80px; right: 30px;
  background-color: var(--accent); color: #ffffff;
  padding: 10px 18px; border-radius: 8px; font-weight: bold;
  z-index: 10000; opacity: 1; transition: opacity 0.4s ease;
}
body.win98-mode .toast { background: #c0c0c0; color: #000; border: 2px solid; border-color: #fff #808080 #808080 #fff; border-radius: 0; }
.toast.hidden { opacity: 0; visibility: hidden; }

/* Win98 desktop layout and touch-friendly mobile layout */
body.win98-mode .app-container { max-width: none; height: calc(100vh - 104px); max-height: none; margin: 0; padding: 12px; }
body.win98-mode #windowPlayer { left: 2%; top: 4%; width: 31% !important; height: calc(100% - 47px) !important; }
body.win98-mode #windowPlaylist { left: 35%; top: 4%; width: 31% !important; height: calc(100% - 47px) !important; }
body.win98-mode #windowLyrics { left: 68%; top: 4%; width: 30% !important; height: calc(100% - 47px) !important; }
body.win98-mode .corner-mode-btn { top: 10px; right: 12px; z-index: 10001; }
body.win98-mode .bottom-player-bar { gap: 4px; }

@media (max-width: 900px) {
    body { min-height: 100dvh; height: 100dvh; overflow: hidden; }
    .app-container { height: calc(100dvh - 145px); max-height: none; padding: 12px; overflow: auto; }
    .view-section { display: flex; flex-direction: column; gap: 12px; height: auto; }
    .win98-window { min-height: 260px; }
    .lyrics-sidebar-section { min-height: 220px; }
    .bottom-player-bar { padding: 8px 12px; gap: 8px; }
    .win98-taskbar-top { gap: 6px; }
    .taskbar-win-btn { max-width: 92px; padding: 3px 5px; font-size: .68rem; }
    .win98-tray-clock { padding: 2px 4px; font-size: .7rem; }
    .progress-container { gap: 7px; }
    .bottom-player-inner { gap: 10px; }
    .buttons-container { gap: 7px; }
    .volume-container { width: 115px; gap: 5px; }
    .corner-mode-btn { top: 10px; right: 10px; padding: 7px 10px; }
    body.win98-mode .app-container { height: calc(100dvh - 152px); padding: 8px; }
    body.win98-mode .view-section { display: flex !important; flex-direction: column; gap: 10px; height: auto; }
    body.win98-mode .win98-window { position: relative !important; inset: auto !important; width: 100% !important; height: 360px !important; min-height: 0; flex: none; }
    body.win98-mode .bottom-player-bar { padding: 6px 8px !important; }
}

@media (max-width: 480px) {
    .app-container { height: calc(100dvh - 166px); padding: 8px; }
    .now-playing-card { gap: 8px; }
    .cover-wrapper.large-cover { width: min(52vw, 180px); height: min(52vw, 180px); }
    .brand-logo { width: 28px; height: 28px; }
    .logo-text { font-size: .82rem; }
    .nav-discord-btn { padding: 5px 8px; font-size: .72rem; }
    .win98-taskbar-top { gap: 4px; }
    .win98-taskbar-windows { gap: 3px; }
    .taskbar-win-btn { max-width: 78px; font-size: .62rem; }
    .win98-tray-clock { display: none !important; }
    .volume-container { width: 82px; font-size: .68rem; }
    .volume-container input { min-width: 34px; }
    .ctrl-btn { width: 27px; height: 27px; }
    body.win98-mode .app-container { height: calc(100dvh - 166px); }
    body.win98-mode .win98-window { height: 320px !important; }
}
