/* The Fellas Jukebox Styles */

.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.nav-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: #667eea;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.view {
    display: none;
}

.view.active {
    display: block !important;
}

/* Playlists List */
.playlists-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.playlist-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.playlist-card h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.playlist-card .playlist-theme {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.playlist-card .playlist-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.playlist-status.submission {
    background: #fff3cd;
    color: #856404;
}

.playlist-status.voting {
    background: #d1ecf1;
    color: #0c5460;
}

.playlist-status.completed {
    background: #d4edda;
    color: #155724;
}

.playlist-card .playlist-deadline {
    font-size: 0.85rem;
    color: #999;
}

/* Admin Panel */
.admin-panel {
    max-width: 600px;
}

.playlist-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.my-playlists {
    margin-top: 40px;
}

.my-playlists h3 {
    margin-bottom: 20px;
}

/* Playlist Detail */
.back-btn {
    margin-bottom: 20px;
    padding: 10px 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #e0e0e0;
}

.playlist-detail {
    background: white;
    border-radius: 12px;
    padding: 30px;
}

.playlist-header-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.playlist-header-info h2 {
    margin: 0 0 10px 0;
}

.playlist-header-info .playlist-theme {
    color: #666;
    margin-bottom: 15px;
}

.countdown {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
    color: #856404;
}

.end-submissions-btn {
    margin-top: 15px;
    padding: 12px 24px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.end-submissions-btn:hover {
    background: #ee5a5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Submission Phase */
.submission-phase {
    margin-top: 30px;
}

.submission-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.submission-form h3 {
    margin-top: 0;
}

.submitted-tracks {
    margin-top: 20px;
}

.submitted-track {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    gap: 15px;
}

.submitted-track img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.submitted-track-info {
    flex: 1;
}

.submitted-track-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.submitted-track-artist {
    color: #666;
    font-size: 0.9rem;
}

.remove-track-btn {
    padding: 8px 16px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-track-btn:hover {
    background: #cc0000;
}

/* Voting Phase */
.voting-phase {
    margin-top: 30px;
}

.votes-remaining {
    background: #d1ecf1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #0c5460;
}

.track-vote-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    gap: 15px;
}

.track-vote-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.track-vote-info {
    flex: 1;
}

.track-vote-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.track-vote-artist {
    color: #666;
    font-size: 0.9rem;
}

.vote-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vote-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: #667eea;
    color: white;
}

.vote-count {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.submit-votes-btn {
    margin-top: 20px;
    padding: 15px 30px;
    background: #1db954;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.submit-votes-btn:hover {
    background: #1aa34a;
}

.submit-votes-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.save-spotify-btn,
.save-youtube-btn {
    margin-top: 15px;
    padding: 12px 24px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.2s;
}

.save-spotify-btn {
    background: #1db954;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.save-spotify-btn:hover:not(:disabled) {
    background: #1aa34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 185, 84, 0.4);
}

.save-youtube-btn {
    background: #ff0000;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.save-youtube-btn:hover:not(:disabled) {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.save-spotify-btn:disabled,
.save-youtube-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results Phase */
.results-phase {
    margin-top: 30px;
}

.results-track {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 15px;
    gap: 20px;
}

.results-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    min-width: 40px;
}

.results-track img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
}

.results-track-info {
    flex: 1;
}

.results-track-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

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

.results-track-submitter {
    color: #999;
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

.results-votes {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1db954;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.modal-content p {
    margin: 0 0 25px 0;
    color: #666;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-primary {
    background: #667eea;
    color: white;
}

.modal-btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.modal-btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* All Submissions View */
.all-submissions {
    margin-top: 30px;
}

.submission-user {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.submission-user h4 {
    margin: 0 0 15px 0;
    color: #667eea;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    text-align: left;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-btn {
    padding: 12px 24px;
    background: #111;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.spotify-icon {
    font-size: 1.2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.spotify-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0a7a32;
    background: rgba(29, 185, 84, 0.2);
    padding: 4px 10px;
    border-radius: 999px;
}

.connect-spotify-btn {
    padding: 6px 12px;
    background: #1db954;
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.connect-spotify-btn:hover {
    background: #1ed760;
}

.guest-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.guest-login-form input {
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.input-section {
    margin-bottom: 30px;
}

.songs-input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.song-input-wrapper {
    position: relative;
}

.song-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.typeahead-container {
    position: relative;
}

.song-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.song-input:focus {
    outline: none;
    border-color: #667eea;
}

.typeahead-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

.typeahead-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.typeahead-item:last-child {
    border-bottom: none;
}

.typeahead-item:hover,
.typeahead-item.active {
    background: #f8f9fa;
}

.typeahead-image {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.typeahead-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.typeahead-artist {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.typeahead-no-results,
.typeahead-error {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.selected-song {
    margin-top: 8px;
}

.selected-song-content {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 10px;
    gap: 12px;
}

.selected-song-image {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.selected-song-info {
    flex: 1;
    min-width: 0;
}

.selected-song-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-song-artist {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-song-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.selected-song-remove:hover {
    background: #cc0000;
}

.generate-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.playlist-section {
    margin-top: 40px;
    animation: fadeIn 0.5s;
}

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

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.playlist-header h2 {
    color: #333;
    font-size: 1.8rem;
}

.playlist-stats {
    color: #666;
    font-size: 0.9rem;
}

.playlist-container {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.2s;
}

.track-item:hover {
    background: #e9ecef;
}

.track-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.track-info {
    flex: 1;
}

.track-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.track-artist {
    color: #666;
    font-size: 0.9rem;
}

.track-album {
    color: #999;
    font-size: 0.85rem;
    margin-top: 3px;
}

.playlist-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.save-spotify-btn,
.export-btn,
.new-playlist-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.save-spotify-btn {
    background: #1db954;
    color: white;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.save-spotify-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 185, 84, 0.4);
}

.save-spotify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spotify-share-card {
    margin-top: 20px;
    padding: 18px;
    background: #f3fbf6;
    border: 1px solid #cdeed9;
    border-radius: 12px;
}

.spotify-share-card h4 {
    margin: 0 0 8px;
}

.spotify-share-card p {
    margin: 0 0 14px;
    color: #444;
    line-height: 1.4;
}

.spotify-share-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.copy-link-btn {
    padding: 12px 18px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
}

.spotify-share-url {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}
    opacity: 0.6;
    cursor: not-allowed;
}

.export-btn {
    background: #667eea;
    color: white;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.new-playlist-btn {
    background: #f0f0f0;
    color: #333;
}

.new-playlist-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.playlist-name-input {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.playlist-name-input input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.playlist-name-input input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #c33;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #3c3;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Scrollbar styling */
.playlist-container::-webkit-scrollbar {
    width: 8px;
}

.playlist-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.playlist-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

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

/* Scrollbar styling for typeahead */
.typeahead-dropdown::-webkit-scrollbar {
    width: 6px;
}

.typeahead-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.typeahead-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

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

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    header h1,
    .subtitle {
        text-align: center;
    }

    .auth-section {
        width: 100%;
        justify-content: center;
    }

    main {
        padding: 20px;
    }

    .playlist-actions {
        flex-direction: column;
    }

    .playlist-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
    }

    .songs-input-container {
        gap: 15px;
    }
}

