:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --background-color: #1a1a2e;
    --text-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: url('assets/Ebru_marbling.jpeg') center/cover no-repeat fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 800px;
    width: 100%;
    height: 96vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-size: 2em;
}

.player {
    padding: 15px 30px;
    background: #f3f0ff;
    margin-top: auto;
}

.controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    padding: 0 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 15px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    font-weight: 600;
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.speed-select {
    padding: 8px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: white;
    color: var(--primary-color);
    font-size: 1em;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.speed-select:hover {
    background: #f3f0ff;
}

.speed-select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.now-playing {
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.track-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.track-artist {
    font-size: 1em;
    color: #666;
}

#audio-player {
    width: 100%;
    margin-top: 15px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 0%;
    transition: width 0.1s linear;
}

.playlist {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f3f0ff;
    gap: 20px;
}

.playlist h2 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.search-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

#search-input {
    flex: 1;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#clear-search {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.2em;
    color: #999;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

#clear-search:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

#track-list {
    height: 100%;
}

.track-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.track-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    border-left-color: var(--primary-color);
}

.track-item.active {
    background: var(--primary-color);
    color: white;
    border-left-color: var(--secondary-color);
    position: sticky;
    top: 0;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.track-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.track-item-info {
    flex: 1;
    min-width: 0;
}

.track-item-title {
    font-weight: bold;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-item-meta {
    font-size: 0.9em;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 40px;
    height: 40px;
}

.share-btn:hover {
    color: var(--secondary-color);
    transform: scale(1.2);
}

.share-btn.share-success {
    color: #28a745;
}

.track-item.active .share-btn {
    color: white;
}

.track-item.active .share-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.error {
    text-align: center;
    color: #d9534f;
    padding: 20px;
}

/* Copy message toast */
.copy-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.copy-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.copy-message-error {
    background: #d9534f;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }
    
    .container {
        max-height: 92vh;
        height: auto;
    }
    
    h1 {
        font-size: 1.5em;
        padding: 20px;
    }
    
    .player {
        padding: 20px;
    }
    
    .playlist {
        padding: 20px;
    }
    
    .playlist-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .playlist h2 {
        font-size: 1.3em;
    }
    
    .track-title {
        font-size: 1.2em;
    }
    
    .track-item {
        padding: 12px;
    }
    
    .track-item:hover {
        transform: none;
    }
    
    .share-btn {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.9em;
    }
    
    .control-btn {
        padding: 8px 6px;
        font-size: 0.8em;
        min-width: 0;
    }
    
    .speed-select {
        padding: 8px 6px;
        font-size: 0.8em;
    }
}
