:root {
    --bg-color: #0f0f0f;
    --surface-color: #1a1a1a;
    --primary-color: #00e676;
    --primary-hover: #00c853;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --transition-speed: 0.4s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 0px;
}
::-webkit-scrollbar:horizontal {
    display: none;
    height: 0px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.app-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,230,118,0.3);
    flex-shrink: 0;
}
.app-header h1.logo {
    font-size: 1.15rem;
    line-height: 1.2;
    margin: 0;
}

/* Animations and Smooth Transitions */
.smooth-btn {
    background: var(--surface-color);
    color: var(--text-primary);
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.smooth-btn:hover {
    background: #252525;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.smooth-btn:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Header buttons */
.lang-btn {
    background: transparent;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}
.lang-btn:hover {
    background: #444;
    transform: scale(1.1);
}

.settings-btn {
    background: #222;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.settings-btn:hover {
    background: #444;
    transform: scale(1.05);
}

.primary-btn {
    background: var(--primary-color);
    color: #000;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

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

.secondary-btn {
    width: 100%;
    margin-top: 15px;
    background: #222;
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playlist-io-btns {
    display: flex;
    gap: 10px;
}

.io-btn {
    flex: 1;
    background: #2a2a2a;
    font-size: 0.95rem;
    padding: 10px;
}

.io-btn:hover {
    background: #333;
}

/* Text Fade Animation for Translation */
.fade-text {
    display: inline-block;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}
.fade-text.hidden {
    opacity: 0;
    transform: translateY(-5px);
}

/* Player UI */
.now-playing-container {
    background: var(--surface-color);
    padding: 25px 20px;
    border-radius: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.label-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.track-name {
    font-size: 1.2rem;
    margin-bottom: 25px;
    font-weight: 700;
    width: 100%;
    
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Progress Bar */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    background: #333;
    height: 6px;
    border-radius: 3px;
    outline: none;
    transition: background var(--transition-speed) ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.4);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.control-btn { display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    padding: 0;
}

.play-btn {
    font-size: 2rem;
    width: 75px;
    height: 75px;
    background: var(--primary-color);
    color: #000;
    padding-left: 5px; /* Visual center for play icon */
}

.play-btn.playing {
    padding-left: 0; /* Center pause icon properly */
}

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

/* Views Logic */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}
.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Home View specific */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.playlist-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.playlist-card:hover {
    background: #252525;
    transform: translateX(6px);
    border-left: 4px solid var(--primary-color);
}

.playlist-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 15px;
    flex-shrink: 0;
}

.play-pl-btn {
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.play-pl-btn:hover {
    transform: scale(1.15);
    background: var(--primary-hover);
}

/* Detail View specific */
.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.back-btn {
    background: #222;
    padding: 10px 15px;
}

/* Playlist Lists */
.playlist-section {
    margin-top: 20px;
    flex: 1;
    overflow-x: hidden;
}

.playlist-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.scrollable-list {
    list-style: none;
    overflow-y: auto;
    overflow-x: hidden !important;
    max-height: 45vh;
    padding-bottom: 20px;
    padding-right: 5px; /* space for scrollbar */
    width: 100%;
    box-sizing: border-box;
}

.scrollable-list li {
    padding: 15px;
    background: var(--surface-color);
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.scrollable-list li:hover {
    background: #252525;
    transform: translateX(6px);
}

.scrollable-list li.active {
    background: rgba(0, 230, 118, 0.1);
    border-left: 5px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
    transform: translateX(6px);
}

.track-name-span {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    word-break: break-word;
}


.track-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.move-btn, .delete-track-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
    transition: transform 0.2s;
    border-radius: 5px;
}
.move-btn { display: flex; align-items: center; justify-content: center; gap: 0;
    color: var(--text-secondary);
}
.move-btn:hover {
    color: var(--primary-color);
    transform: scale(1.3);
}

.delete-track-btn {
    color: #ff5252;
}
.delete-track-btn:hover {
    transform: scale(1.3);
    background: rgba(255, 82, 82, 0.1);
}

.settings-btn { background: #222; color: #fff; border: none; padding: 5px 15px; border-radius: 20px; font-weight: bold; cursor: pointer; transition: all var(--transition-speed) ease; font-size: 0.85rem; }
.settings-btn:hover { background: #444; transform: scale(1.05); }

.brand-container { display: flex; align-items: center; gap: 12px; }
.app-logo-img { width: 36px; height: 36px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,230,118,0.3); }
.app-header h1.logo { font-size: 1.3rem; }
