/* Lyrical - Premium Music Player Styles */

/* Local custom fonts */
@font-face { font-family: 'BrittiSans'; src: url('fonts/BrittiSansTrial-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Canopee'; src: url('fonts/Canopee-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PerfectlyAmicable'; src: url('fonts/perfectlyamicable.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --bg-dark: #000000;
    --bg-sidebar: #0f0f0f;
    --bg-card: #181818;
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --border: #27272a;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Layout */
#app {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sidebar-header,
.mini-player {
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.mini-player {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo .badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.search-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.search-input-wrapper input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

/* Search Results */
.search-results-list {
    flex: 1 1 auto;
    height: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

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

.empty-state-sidebar {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2rem;
}

.empty-state-sidebar.error {
    color: #ff4d4d;
}

/* Search Result Items */
.search-result-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--bg-card);
}

.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.search-result-item .meta {
    flex: 1;
    overflow: hidden;
}

.search-result-item h3 {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.search-result-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge-lyrics-avail {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 3px;
}

/* Mini Player */
.player-track-info {
    text-align: center;
    margin-bottom: 1rem;
}

.player-track-info img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    margin-bottom: 10px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.p-title {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-artist {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.ctrl-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.ctrl-btn:hover {
    color: var(--primary);
}

.ctrl-btn.sm {
    font-size: 1.2rem;
}

.ctrl-btn.main-play {
    font-size: 1.5rem;
    background: #fff;
    color: #000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
}

.ctrl-btn.main-play:hover {
    transform: scale(1.05);
    color: var(--primary);
}

.player-progress-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

input[type="range"] {
    flex: 1;
    height: 4px;
    background: #333;
    -webkit-appearance: none;
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.mini-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
}

.nav-btn:hover {
    color: #fff;
    background: var(--bg-card);
}

.nav-btn.active {
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

/* Main Content */
.main-content {
    position: relative;
    background: var(--bg-dark);
}

.view {
    display: none;
    height: 100%;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

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

/* Lyrics View */
#lyrics-view {
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 70%);
    overflow: hidden;
    position: relative;
}

#lyrics-view.active {
    display: flex;
}

.lyrics-display {
    max-width: 100%;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.lyrics-scroller {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    will-change: transform;
}

.lyrics-placeholder {
    font-size: 2rem;
    color: #333;
    font-weight: 700;
    margin-top: 40vh;
}

/* Lyric Lines */
.lyric-line-focus {
    font-size: clamp(2rem, 7vw, 6rem);
    font-weight: 900;
    margin: 0;
    color: var(--text-muted);
    opacity: 0;
    position: absolute;
    left: 50%;
    width: 100%;
    max-width: 90%;
    transition: opacity 0.4s ease, filter 0.4s ease, color 0.4s ease;
    padding: 0;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
    filter: blur(4px);
    cursor: pointer;
    font-family: 'Rozha One', 'Baloo 2', 'Noto Sans Devanagari', 'Noto Sans Gurmukhi', 'Noto Sans', 'Outfit', sans-serif;
}

.lyric-line-focus.active {
    color: #ffffff;
    opacity: 1;
    filter: blur(0px);
}

/* Word styles */
.lyric-line-focus.active .lyric-word {
    display: inline-block;
    margin-right: 0.35em;
}

.static-lyrics {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ccc;
    white-space: pre-wrap;
}

/* Forms & Cards */
h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.btn-refresh {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}

.upload-card {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.group {
    margin-bottom: 1.5rem;
}

.group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.group input,
.group textarea {
    width: 100%;
    padding: 10px;
    background: #000;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Loader */
.loader-container {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Library Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.track-item {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid transparent;
}

.track-item:hover {
    background: #222;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.track-item.playing {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.track-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.track-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.track-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.track-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    font-size: 0.7rem;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    margin-top: auto;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 4rem;
    font-size: 1.1rem;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Beat Pulse Effect */
.beat-pulse {
    animation: beatPulse 0.15s ease-out;
}

@keyframes beatPulse {
    0% { filter: brightness(1); transform: scale(1); }
    20% { filter: brightness(1.8) drop-shadow(0 0 10px rgba(255,255,255,0.5)); transform: scale(1.01); }
    100% { filter: brightness(1); transform: scale(1); }
}

/* Font Classes for Lyrics — English (local custom fonts only) */
.font-britti, .font-britti * { font-family: 'BrittiSans', sans-serif !important; }
.font-canopee, .font-canopee * { font-family: 'Canopee', serif !important; text-transform: uppercase; }
.font-amicable, .font-amicable * { font-family: 'PerfectlyAmicable', cursive !important; }

/* Font class for Indic scripts — Rozha One covers Devanagari (Hindi), with Noto Sans as fallback */
.font-indic, .font-indic * { font-family: 'Rozha One', 'Noto Sans Devanagari', 'Noto Sans Gurmukhi', 'Noto Sans', sans-serif !important; font-weight: 400; }
