/**
 * style.css
 * This file contains the custom styles for the lyrics website.
 * It works in conjunction with Tailwind CSS loaded via CDN in index.html.
 */

/*------------------------------------------------------------------
[Table of Contents]

1.  Base Styles & Variables
2.  Theme Colors (Light & Dark Mode)
3.  Layout & Header
4.  UI Components (Panels, Buttons, Forms)
5.  Typography & Links
6.  Lyrics & Song List Specifics
7.  Search Functionality
8.  Toast Notifications
9.  Transitions & Animations
10. Utility Classes
-------------------------------------------------------------------*/

/* 1. Base Styles & Variables
-------------------------------------------------------------------*/
:root {
    /* Font size for lyrics, can be changed by JS */
    --lyrics-font-size: 1.1rem;
}

html {
    height: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    min-height: 100%;
}

/* 2. Theme Colors (Light & Dark Mode)
-------------------------------------------------------------------*/
[data-theme='light'] {
    --bg-primary: #f9fafb;
    /* gray-50 */
    --bg-secondary: #ffffff;
    /* white */
    --bg-interactive: #ffffff;
    /* white */
    --bg-interactive-hover: #f3f4f6;
    /* gray-100 */
    --text-primary: #111827;
    /* gray-900 */
    --text-secondary: #6b7280;
    /* gray-500 */
    --border-color: #e5e7eb;
    /* gray-200 */
}

[data-theme='dark'] {
    --bg-primary: #111827;
    /* gray-900 */
    --bg-secondary: #1f2937;
    /* gray-800 */
    --bg-interactive: #1f2937;
    /* gray-800 */
    --bg-interactive-hover: #374151;
    /* gray-700 */
    --text-primary: #f9fafb;
    /* gray-50 */
    --text-secondary: #9ca3af;
    /* gray-400 */
    --border-color: #374151;
    /* gray-700 */
}

/* Applying theme colors */
.bg-secondary {
    background-color: var(--bg-secondary);
}

.text-color {
    color: var(--text-primary);
}

.text-color-subtle {
    color: var(--text-secondary);
}

.border-color {
    border-color: var(--border-color);
}

/* 3. Layout & Header
-------------------------------------------------------------------*/
#header {
    border-bottom: 1px solid var(--border-color);
}

/* This is a wrapper for the breadcrumbs and search view to allow for animation */
#header-nav {
    position: relative;
    flex-grow: 1;
    min-width: 0;
    /* Important for flexbox to allow shrinking */
}

#breadcrumbs-view,
#search-view {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.3s ease;
}

#search-view {
    opacity: 0;
    pointer-events: none;
}

/* 4. UI Components (Panels, Buttons, Forms)
-------------------------------------------------------------------*/
.interactive-panel {
    background-color: var(--bg-interactive);
    transition: background-color 0.2s, border-color 0.3s;
    border: 1px solid var(--border-color);
}

.interactive-panel:hover {
    background-color: var(--bg-interactive-hover);
}

.icon-btn {
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

#search-input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

#search-input::placeholder {
    color: var(--text-secondary);
}

/* 5. Typography & Links
-------------------------------------------------------------------*/
a {
    text-decoration: none;
    color: inherit;
}

.breadcrumb-link {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--text-primary);
}

/* 6. Lyrics & Song List Specifics
-------------------------------------------------------------------*/
.lyrics-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* 12px */
    flex-shrink: 0;
    /* Prevent controls from shrinking */
    margin-left: 1rem;
}

.font-size-controls {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    overflow: hidden;
}

.font-size-btn {
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    /* 4px 12px */
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.font-size-btn:hover {
    background-color: var(--bg-interactive-hover);
    color: var(--text-primary);
}

.font-size-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.lyrics-text {
    white-space: pre-wrap;
    font-size: var(--lyrics-font-size);
    margin-top: 1.5rem;
}

.track-number {
    display: inline-block;
    width: 2.5rem;
    flex-shrink: 0;
    transition: width 0.3s ease, opacity 0.3s ease, margin-right 0.3s ease;
    opacity: 1;
    margin-right: 1rem;
    font-weight: bold;
}

[data-show-tracks="false"] .track-number {
    width: 0;
    opacity: 0;
    margin-right: 0;
    overflow: hidden;
}


/* 7. Search Functionality
-------------------------------------------------------------------*/
.search-highlight {
    background-color: #fde047;
    /* yellow-300 */
    color: #1f2937;
    /* gray-800 */
    border-radius: 2px;
    padding: 0 2px;
}

[data-theme='dark'] .search-highlight {
    background-color: #facc15;
    /* yellow-400 */
}

/* 8. Toast Notifications
-------------------------------------------------------------------*/
#toast-notification {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    transition: transform 0.5s ease-in-out;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 50;
}

#toast-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* 9. Notice Panel
-------------------------------------------------------------------*/
.notice-panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.notice-panel p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 10. Utility Classes
-------------------------------------------------------------------*/
.hidden {
    display: none;
}