:root {
    /* Light Theme */
    --bg-color: #ffffff;
    --bg-color-secondary: #f8fafc;
    --text-color: #334155;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.5);
    --accent-color: rgba(15, 23, 42, 0.25);
    --hover-color: #f1f5f9;
    --accent-hover: #1e293b;
    --play-color:  rgba(231, 91, 16, 0.5);
    --shadow: 0 1px 2px rgba(15,23,42,0.05);
    --ring-color: rgba(15,23,42,0.1);
    --ring-offset: 1px;
    
    /* Waveform Colors */
    --wave-color: rgba(100, 116, 139, 0.5);
    --wave-progress-color: rgba(231, 91, 16, 0.5);
    --wave-cursor-color: rgba(231, 91, 16, 1);
    --wave-progressbar-color: rgba(231, 91, 16, 1);
} 

[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-color-secondary: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(51, 65, 85, 0.5);
    --accent-color: rgba(248, 250, 252, 0.25);
    --hover-color: #283548;
    --accent-hover: #e2e8f0;
    --play-color:  rgba(231, 91, 16, 0.5);
    --shadow: 0 1px 2px rgba(15,23,42,0.2);
    --ring-color: rgba(241,245,249,0.1);
    --ring-offset: 1px;

    /* Waveform Colors */
    --wave-color: rgba(241, 245, 249, 0.75);
    --wave-progress-color: rgba(231, 91, 16, 0.5);
    --wave-cursor-color: rgba(231, 91, 16, 1);
    --wave-progressbar-color: rgba(231, 91, 16, 1);
}  

/* Base Styles */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Responsive Grid Layout */
.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-color-secondary);
}

/* Responsive Typography */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* Component Styles */
.waveform-container {
    height: 80px;
    /*
    background: var(--bg-color);
    */
    padding: 0;
    border-radius: 8px;
    /*
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    */

}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher select {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
}

.language-switcher label {
    font-size: 0.9rem;
}

/* Theme & Language Switchers */
.theme-switcher,
.language-switcher {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: var(--shadow);
    min-width: 160px;
    z-index: 30;
}

.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
}

.dropdown-menu button.active {
    color: var(--text-color);
    font-weight: 500;
}

[x-cloak] {
    display: none !important;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 2000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.navbar-start {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-end {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-button {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover {
    color: var(--text-color);
    background: var(--hover-color);
}

.nav-button[aria-expanded="true"] {
    border-color: var(--accent-color);
    color: var(--text-color);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    margin-top: 0.5rem;
    right: 0;
    min-width: 200px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    color: var(--text-color);
    background: var(--hover-color);
}

.dropdown-item.active {
    color: var(--text-color);
    background: var(--hover-color);
}

/* Dropdown Arrow */
.dropdown-arrow {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.2s ease;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* Upload Button */
button.nav-link {
    font-family: inherit;
    margin: 0;
    text-align: left;
}

/* Dropdown Buttons */
.theme-switcher .nav-link,
.language-switcher .nav-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
}

.theme-switcher .nav-link:hover,
.language-switcher .nav-link:hover,
.theme-switcher .nav-link.active,
.language-switcher .nav-link.active {
    color: var(--text-color);
    background: transparent;
}

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

.nav-link.active {
    color: var(--text-color);
    background-color: var(--hover-color);
}

.nav-button.uploading {
    background-color: #e75b10 !important;
    color: white !important;
}

.mobile-hint {
    display: none;
    color: var(--text-muted);
    padding: 0.5rem;
    position: relative;
    z-index: 20;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.4;
    text-align: right;
    max-width: 200px;
}

.mobile-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-hint {
        display: block;
        margin-left: auto;
        max-width: 200px;
        text-align: right;
    }

    .navbar-menu {
        display: none !important;
    }

    .navbar-start,
    .navbar-end {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }

    .theme-switcher,
    .language-switcher {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        margin-top: 0.5rem;
        width: 100%;
        background-color: var(--bg-color-secondary);
        box-sizing: border-box;
    }

    /* Ensure brand stays visible */
    .navbar-brand {
        margin-right: 0;
        z-index: 20;
        font-size: 1.25rem;
    }

    /* Adjust mobile menu button */
    .menu-icon {
        width: 24px;
        height: 24px;
        stroke-width: 2;
    }

    .navbar-container {
        padding: 0 1.5rem;
    }
} 

/* Dropdown Styles */
.dropdown-arrow {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    transition: transform 0.2s ease;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Alpine.js Transitions */
.transition {
    transition-property: opacity, transform;
}

.duration-75 {
    transition-duration: 75ms;
}

.duration-100 {
    transition-duration: 100ms;
}

.ease-in {
    transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.scale-95 {
    transform: scale(0.95);
}

.scale-100 {
    transform: scale(1);
} 

/* Ensure end items stay at the end */
.navbar-end {
    margin-left: auto;
} 

/* Global Focus Styles */
*:focus-visible {
    outline: none;
    box-shadow: 0 0 0 var(--ring-offset) var(--bg-color),
                0 0 0 calc(var(--ring-offset) + 2px) var(--ring-color);
}

/* Remove focus styles for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
} 

/* Utility Classes */
.hidden {
    display: none !important;
} 

/* Upload Panel */
.upload-panel.left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 600px;
    background: var(--bg-color);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    z-index: 1500;
    padding: 2rem;
    overflow-y: auto;
    margin-top: 64px;
    height: calc(100vh - 64px);
}

.auth-panel.right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 600px;
    background: var(--bg-color);
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    z-index: 1500;
    padding: 2rem;
    overflow-y: auto;
    margin-top: 64px;
    height: calc(100vh - 64px);
}

.close-panel {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    transition: all 0.2s;
}

.close-panel:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

/* Slide Animations */
.slide-in-right {
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-out-right {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left {
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-out-left {
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Upload Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group select,
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group select:hover,
.form-group input[type="text"]:hover,
.form-group textarea:hover {
    border-color: var(--text-muted);
}

.form-group select:focus,
.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-color);
} 

/* Ladebalken Animation */
.progress-bar {
    position: relative;
    height: 4px;
    margin: 1rem 0;
    background-color: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    --progress: 0%;
}

/* Ladebalken Container */
.upload-progress {
    background: var(--bg-color-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

/* Progress Text Container */
.progress-text-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Progress Status */
.progress-status {
    font-weight: 500;
}

/* Progress Percentage */
.progress-percentage {
    color: var(--text-muted);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress);
    background-color: #e75b10;
    border-radius: 2px;
    transition: width 0.2s ease-out;
} 

/* Explore Styles */
.explore-container {
    max-width: 1200px;
    margin: 0 auto;
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    background: var(--bg-color);
}

.track-card {
    background: var(--bg-color-secondary);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s ease;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 1rem;
    height: 100%;
}

.track-content {
    display: grid;
    gap: 1rem;
}

.track-info {
    min-height: 0;
}

.track-controls {
    align-self: end;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.track-card:hover {
    transform: translateY(-2px);
}

.play-button {
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-button:hover {
    color: var(--text-color);
    background: var(--hover-color);
}

.play-button.playing {
    border-color: var(--play-color);
    color: var(--text-color);
}

.play-button.loading {
    opacity: 0.7;
    cursor: wait;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.play-button:disabled {
    pointer-events: none;
}

/* Explore Panel */
.explore-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 1500;
    padding: 2rem;
    overflow-y: auto;
    margin-top: 64px;
    height: calc(100vh - 64px);
}

/* Slide Animations für Explore */
.slide-in-top {
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-out-top {
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
} 

/* Waveform Loading Bar */
.waveform-loading-container {

    height: 60px;
    /*
    display: flex;
    */
    align-items: center;
    justify-content: center;
    /*
    background: var(--bg-color-secondary);
    */
    border-radius: 4px;
    padding: 1rem;
}

.waveform-loading-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.waveform-loading-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--wave-progressbar-color);
    transition: width 0.3s ease;
} 

/* Pagination */
.pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.page-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.page-button:hover {
    color: var(--text-color);
    background: var(--hover-color);
}

.page-button.active {
    color: var(--text-color);
    background: var(--hover-color);
} 

/* Track Header Layout */
.track-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Track Stats */
.track-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.plays-count {
    display: flex;
    flex-direction: column;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.plays-count .count {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Track Cover Styles */
.cover-container {
    position: relative;
    width: 200px;
    height: 200px;
    overflow: hidden;
    border-radius: 0.5rem;
    background: var(--bg-color);
}

.track-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.track-card:hover .track-cover {
    transform: scale(1.05);
} 

/* Auth Form Styles */
.auth-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-color-secondary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

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

.auth-form .form-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.auth-form .form-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.auth-form .error-message {
    color: #ef4444;
    font-size: 0.875rem;
}

.auth-form .success-message {
    color: #10b981;
    font-size: 0.875rem;
} 

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 50;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    color: var(--text-color);
    background: var(--hover-color);
}

.dropdown-item.active {
    color: var(--text-color);
    background: var(--hover-color);
}

.nav-button.active {
    border-color: var(--accent-color);
    color: var(--text-color);
}

/* Dropdown Arrow */
.dropdown-arrow {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.dropdown-arrow.rotate-180 {
    transform: rotate(180deg);
} 

.genre-text {
    width: 200px;
    height: 20px;
    margin-top: -15px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
} 