@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Space Grotesk', sans-serif; background-color: #000; color: #000; overflow: hidden; }

/* Dynamic Blur Background */
.dynamic-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('https://via.placeholder.com/10');
    background-size: cover; background-position: center;
    filter: blur(50px) brightness(0.2); z-index: -1; transition: background-image 0.5s ease;
}

/* === NEOBRUTALISM BASICS === */
.text-btn {
    background: #fff; border: 3px solid #000; padding: 8px 12px; font-weight: 900; 
    cursor: pointer; box-shadow: 3px 3px 0px #000; font-size: 0.9rem; 
    text-transform: uppercase; transition: all 0.1s; display: inline-flex; justify-content: center; align-items: center;
}
.text-btn:active { transform: translate(3px, 3px); box-shadow: 0px 0px 0px #000; }
.small-btn { padding: 5px 8px; font-size: 0.8rem; box-shadow: 2px 2px 0px #000; }
.btn-active { background: #ff5252 !important; color: #fff !important; }
.disabled { opacity: 0.5; pointer-events: none; }

/* === CORE LAYOUT === */
.app-layout { display: flex; flex-direction: column; height: 100dvh; width: 100vw; background-color: rgba(244, 244, 240, 0.95); }
.desktop-only { display: none !important; } .mobile-only { display: block; }
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.top-bar { padding: 15px; background: #ccff00; border-bottom: 4px solid #000; display: flex; flex-direction: column; gap: 10px; }
.logo { font-size: 1.5rem; font-weight: 900; }
.search-container { display: flex; gap: 8px; width: 100%; }
.search-container input { flex: 1; padding: 10px; border: 3px solid #000; font-weight: bold; min-width: 0; }
.search-container button { background: #ff5252; color: white; }

.scrollable-content { flex: 1; overflow-y: auto; padding: 15px; }
.view-section { display: none; animation: fadeIn 0.3s; }
.view-section.active-view { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.section-title { font-size: 1.2rem; background: #00e5ff; padding: 5px 10px; border: 3px solid #000; box-shadow: 4px 4px 0px #000; display: inline-block; margin-bottom: 15px; font-weight: 900;}
.empty-state { font-weight: bold; opacity: 0.7; }

.list-container { display: flex; flex-direction: column; gap: 10px; }
.grid-container { display: grid; grid-template-columns: 1fr; gap: 10px; }
.music-card, .list-item, .comic-card {
    display: flex; align-items: center; background: #fff; border: 3px solid #000; 
    padding: 10px; gap: 15px; box-shadow: 4px 4px 0px #000; cursor: pointer; transition: transform 0.1s; min-width: 0;
}
.music-card:active, .list-item:active, .comic-card:active { transform: translate(3px, 3px); box-shadow: 0px 0px 0px #000; }
.music-card img, .list-item img { width: 50px; height: 50px; border: 2px solid #000; object-fit: cover; flex-shrink: 0; }
.music-card-info, .list-item div { flex: 1; min-width: 0; overflow: hidden; }
.music-card h4, .list-item h4 { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; }

/* === COMIC STYLES & FILTERS === */
.comic-filters { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; white-space: nowrap; scrollbar-width: none; }
.comic-filters::-webkit-scrollbar { display: none; }
.comic-card { flex-direction: column; text-align: center; border-radius: 10px; padding: 10px; }
.comic-card img { width: 100%; aspect-ratio: 3/4; border-radius: 5px; margin-bottom: 10px; border: 2px solid #000; object-fit: cover; }
.comic-card h4 { font-size: 0.85rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal;}
.comic-badge { background: #000; color: #fff; font-size: 0.7rem; padding: 2px 5px; border-radius: 3px; font-weight: bold; margin-top: 5px;}

.comic-detail-header { display: flex; gap: 20px; background: #fff; padding: 20px; border: 4px solid #000; box-shadow: 6px 6px 0px #000; margin-bottom: 20px; border-radius: 10px;}
.comic-detail-cover { width: 120px; height: 160px; object-fit: cover; border: 3px solid #000; flex-shrink: 0;}
.comic-detail-info h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: 10px; }
.comic-detail-info p { font-size: 0.9rem; font-weight: bold; margin-bottom: 5px; opacity: 0.8; }
.comic-desc { margin-top: 10px; font-size: 0.85rem; line-height: 1.4; border-top: 2px dashed #000; padding-top: 10px;}
.chapter-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #fff; border: 3px solid #000; margin-bottom: 10px; font-weight: bold; cursor: pointer; box-shadow: 4px 4px 0px #000;}
.chapter-item:active { transform: translate(3px, 3px); box-shadow: none; }

/* === COMIC READER OVERLAY === */
.comic-reader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: #1a1a1a; z-index: 9990; display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform 0.3s ease;
}
.comic-reader.active { transform: translateY(0); }
.comic-reader-header {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; padding: 15px; border-bottom: 4px solid #000; flex-shrink: 0;
}
.comic-reader-header h3 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; text-align: center; }
.comic-images-container { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; background: #000; padding-bottom: 50px;}
.comic-images-container img { max-width: 100%; width: 100%; object-fit: contain; display: block; margin: 0; }
.reader-nav-btns { display: flex; gap: 5px; }

/* === PLAYER BAR (Bottom) === */
.player-bar { height: 75px; background: #ff9800; border-top: 4px solid #000; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; position: relative; z-index: 50; flex-shrink: 0; }
.player-bar.hidden { display: none !important; }
.mini-progress-bar { position: absolute; top: -4px; left: 0; height: 4px; background: #ccff00; width: 0%; z-index: 52; }
.player-bar-content { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.player-bar-content img { width: 45px; height: 45px; border: 2px solid #000; object-fit: cover; flex-shrink: 0; }
.mini-info { flex: 1; min-width: 0; overflow: hidden; }
.mini-info h4 { font-size: 0.95rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info p { font-size: 0.8rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.8;}
.mini-controls { display: flex; gap: 8px; flex-shrink: 0; }
.play-btn { background: #ccff00; border-color: #000; }

.mobile-nav { display: flex; background: #fff; border-top: 4px solid #000; justify-content: space-around; align-items: center; height: 65px; flex-shrink: 0; z-index: 50; }
.nav-btn { background: none; border: none; font-weight: 900; font-family: inherit; font-size: 1.2rem; color: #666; cursor: pointer; padding: 10px; flex: 1; text-align: center; }
.nav-btn.active { color: #6200ea; text-decoration: underline; text-underline-offset: 4px; }

/* === FULL PLAYER OVERLAY === */
.full-player {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: linear-gradient(180deg, #ff9800 0%, #f4f4f0 100%);
    z-index: 9999; display: flex; flex-direction: column; padding: 20px 20px 30px 20px;
    transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); overflow-y: auto;
}
.full-player.active { transform: translateY(0); }

.player-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2vh; flex-shrink: 0; }
.badge { background: #000; color: #ccff00; padding: 5px 10px; border: 2px solid #000; font-weight: 900; font-size: 0.7rem; }
.player-body { display: flex; flex-direction: column; flex: 1; justify-content: space-between; align-items: center; width: 100%; max-width: 450px; margin: 0 auto; }

.album-art-container { display: flex; justify-content: center; align-items: center; flex: 1; width: 100%; min-height: 25vh; margin-bottom: 3vh; }
.cover-wrapper { position: relative; display: flex; justify-content: center; align-items: center; border-radius: 50%; }
.rotating-cover { width: min(280px, 70vw); height: min(280px, 70vw); border-radius: 50%; border: 6px solid #000; object-fit: cover; box-shadow: 8px 8px 0px rgba(0,0,0,0.4); }
.rotating-cover.spin { animation: spin 8s linear infinite; }
.rotating-cover.paused { animation-play-state: paused; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.loading-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.65); color: #ccff00; display: flex; justify-content: center; align-items: center; border-radius: 50%; font-weight: 900; font-size: 1.5rem; letter-spacing: 2px; opacity: 0; pointer-events: none; transition: opacity 0.2s; border: 6px solid transparent; }
.loading-overlay.active { opacity: 1; pointer-events: auto; }

.player-controls-container { width: 100%; }
.track-info { text-align: center; margin-bottom: 2.5vh; width: 100%; }
#player-title { font-size: 1.4rem; font-weight: 900; line-height: 1.2; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#player-artist { font-size: 0.9rem; font-weight: bold; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.action-row { display: flex; justify-content: center; gap: 15px; margin-bottom: 2.5vh; }
.progress-container { display: flex; align-items: center; gap: 10px; margin-bottom: 3vh; font-weight: bold; font-size: 0.8rem; }
#progress-bar { flex: 1; appearance: none; height: 6px; background: #fff; border: 2px solid #000; cursor: pointer; outline: none; border-radius: 5px; }
#progress-bar::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; background: #ff5252; border: 3px solid #000; cursor: pointer; border-radius: 50%; }

.controls-row { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 3vh; }
.controls-row .text-btn { font-size: 0.8rem; padding: 8px 10px; }
.controls-row .small-btn { padding: 6px 8px; font-size: 0.7rem; }
.play-pause-btn { background: #ccff00; border: 4px solid #000; width: 65px; height: 65px; border-radius: 50%; font-size: 1rem; font-weight: 900; cursor: pointer; box-shadow: 4px 4px 0px #000; display: flex; justify-content: center; align-items: center; transition: all 0.1s; }
.play-pause-btn:active { transform: translate(3px, 3px); box-shadow: none; }

.lyrics-box { background: #000; color: #00e5ff; border: 3px solid #000; padding: 15px; text-align: center; font-weight: bold; font-size: 1rem; border-radius: 15px; min-height: 60px; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 450px; margin: 0 auto; }

/* === DESKTOP === */
@media (min-width: 768px) {
    .app-layout { grid-template-rows: 1fr auto; display: grid; grid-template-columns: 250px 1fr; }
    .desktop-only { display: flex !important; } .mobile-only { display: none !important; }
    .sidebar { border-right: 4px solid #000; background: #fff; padding: 20px; flex-direction: column; grid-column: 1; grid-row: 1; overflow-y: auto; }
    .sidebar .logo { margin-bottom: 30px; font-size: 1.8rem; }
    .sidebar .nav-links { display: flex; flex-direction: column; gap: 15px; width: 100%; }
    .sidebar .nav-btn { text-align: left; padding: 10px 0; font-size: 1.1rem; border: none; box-shadow: none; border-bottom: 2px solid transparent;}
    .sidebar .nav-btn.active { border-bottom: 2px solid #000; text-decoration: none; }
    .sidebar-extra { margin-top: auto; padding: 15px; background: #ccff00; border: 3px solid #000; font-weight: bold; font-size: 0.8rem; box-shadow: 4px 4px 0px #000;}

    .main-area { grid-column: 2; grid-row: 1; }
    .top-bar { flex-direction: row; justify-content: space-between; align-items: center; }
    .search-container { max-width: 400px; }
    .grid-container { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
    .music-card { flex-direction: column; text-align: center; border-radius: 10px; padding: 15px; }
    .music-card img { width: 100%; height: 150px; border-radius: 5px; margin-bottom: 10px; }
    .music-card-info { width: 100%; }
    
    .comic-detail-header { flex-direction: row; align-items: flex-start; }
    .comic-detail-cover { width: 200px; height: 280px; }
    .comic-images-container img { max-width: 800px; }

    .player-bar { grid-column: 1 / -1; grid-row: 2; height: 90px; padding: 0 30px; }
    .player-bar-content { flex: 0.3; }
    .mini-controls { flex: 0.4; justify-content: center; gap: 15px; }
    .volume-box { flex: 0.3; justify-content: flex-end; align-items: center; gap: 10px; }
    #volume-slider { width: 100px; accent-color: #000; }
    
    .full-player { padding: 40px; }
    .player-body { flex-direction: row; justify-content: center; gap: 60px; max-width: 900px;}
    .rotating-cover { width: 350px; height: 350px; }
    .player-controls-container { flex: 1; max-width: 450px; }
}