/* Reset and Base Styles */
* {
    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, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px; /* Space for bottom nav */
}

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

.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top: 3px solid #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Screen */
.login-container {
    text-align: center;
    max-width: 400px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff0000, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-container p {
    margin-bottom: 30px;
    color: #cccccc;
    font-size: 1.1rem;
}

.login-container h2 {
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1.5rem;
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
}

.auth-switch a {
    color: #ff0000;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    display: flex;
    align-items: center;
}

.app-header h1 {
    font-size: 1.5rem;
    background: linear-gradient(45deg, #ff0000, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Expandable Menu */
.expandable-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 99;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.menu-content {
    padding: 20px;
}

.menu-section {
    margin-bottom: 25px;
}

.menu-section h3 {
    color: #ff0000;
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-icon {
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    margin-bottom: 80px; /* Space for bottom nav */
}

/* Menu Section */
.menu-section {
    padding: 20px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
}

.menu-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.menu-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.menu-text h3 {
    color: white;
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.menu-text p {
    color: #888;
    margin: 0;
    font-size: 0.9rem;
}

/* Playlists Section */
.playlists-section {
    padding: 20px;
}

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

.playlists-header h2 {
    color: white;
    margin: 0;
}

/* Search Section */
.search-section {
    padding: 20px;
}

.search-section h2 {
    color: white;
    margin: 0 0 20px 0;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: none;
    border: none;
    color: #aaaaaa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-item.active {
    color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content:not(.hidden) {
    display: block;
}

.tab-content.hidden {
    display: none !important;
}

/* Form Styles */
input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

input[type="text"]::placeholder, input[type="email"]::placeholder, input[type="password"]::placeholder {
    color: #aaaaaa;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

/* Button Styles */
button, .btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(45deg, #ff0000, #ff6b6b);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #ff6b6b);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* Party Controls */
.party-controls {
    max-width: 800px;
    margin: 0 auto;
}

.create-party-section, .join-party-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.create-party-section h2, .join-party-section h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #ffffff;
}

.party-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.party-code {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff0000;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-left: 10px;
}

.party-controls-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* YouTube Player */
#youtube-player-container {
    margin: 20px 0;
    text-align: center;
}

#youtube-player {
    width: 100%;
    max-width: 600px;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    background: #000;
}

/* YouTube iframe styling */
#youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 15px;
}


/* Current Song Info */
.current-song {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.song-details {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

#current-song-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
}

.song-text h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.song-text p {
    color: #aaaaaa;
    font-size: 0.9rem;
}

.player-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Playlist Selection */
.playlist-selection {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.playlist-selection h3 {
    margin-bottom: 15px;
    color: #ffffff;
}

.playlist-selection select {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.playlist-selection select option {
    background: #2d2d2d;
    color: #ffffff;
}

/* Search Results */
.search-results {
    margin-top: 20px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.search-result-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #ffffff;
}

.search-result-artist {
    color: #aaaaaa;
    font-size: 0.9rem;
}

.search-result-duration {
    color: #888888;
    font-size: 0.8rem;
}

/* Mobile-First Queue Layout */
.queue-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
}

.queue-now-playing-fixed {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    flex-shrink: 0;
    max-height: 25vh;
    overflow: hidden;
}

.queue-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    min-height: 0; /* Allow flex item to shrink below content size */
}

/* Mobile-First App Styles */
body {
    font-size: 14px;
    line-height: 1.4;
}

.main-content {
    padding: 10px;
    margin-bottom: 80px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .queue-now-playing-fixed {
        padding: 10px;
        max-height: 20vh;
    }
    
    .queue-scrollable {
        padding: 10px;
    }
    
    .current-song-player {
        padding: 6px 8px;
        min-height: 45px;
        gap: 8px;
    }
    
    .current-song-player h2 {
        font-size: 0.85rem;
        min-width: 70px;
    }
    
    .queue-song-info .song-details {
        gap: 8px;
    }
    
    .queue-song-info .song-details img {
        width: 35px;
        height: 35px;
    }
    
    .queue-song-info .song-text h3 {
        font-size: 0.85rem;
    }
    
    .queue-song-info .song-text p {
        font-size: 0.75rem;
    }
    
    .queue-song-info .player-controls button {
        padding: 3px 6px;
        font-size: 0.75rem;
        min-width: 28px;
        height: 24px;
    }
    
    .song-text h3 {
        font-size: 1rem;
    }
    
    .song-text p {
        font-size: 0.9rem;
    }
    
    .player-controls {
        gap: 8px;
    }
    
    .player-controls button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .menu-option {
        padding: 15px;
    }
    
    .menu-icon {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    
    .menu-text h3 {
        font-size: 1rem;
    }
    
    .menu-text p {
        font-size: 0.8rem;
    }
    
    .bottom-nav {
        padding: 8px 0;
    }
    
    .nav-item {
        padding: 8px 4px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
    .queue-now-playing-fixed {
        max-height: 25vh;
        background: #232323;
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .main-content {
        padding: 20px;
    }
    
    .queue-now-playing-fixed {
        padding: 20px;
    }
    
    .queue-scrollable {
        padding: 20px;
    }
}

/* Queue */
.queue-list {
    margin-top: 20px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 6px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-height: 50px;
}

.queue-item.played-song {
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.6;
    border-left: 4px solid #ff6b6b;
}

.queue-item.played-song .queue-item-title {
    text-decoration: line-through;
    color: #888;
}

.queue-item.played-song .queue-item-artist {
    color: #666;
}

.queue-item.current-song {
    background: rgba(34, 197, 94, 0.2);
    border-left: 4px solid #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.queue-item.current-song .queue-item-title {
    color: #22c55e;
    font-weight: bold;
}

.queue-item.current-song .vote-count {
    color: #22c55e;
    font-weight: bold;
}

/* Remove Song Button */
.remove-queue-song-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 8px;
}

.remove-queue-song-btn:hover {
    background: #c82333;
}

.remove-queue-song-btn:active {
    background: #bd2130;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.queue-item-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.queue-item-title {
    font-weight: 600;
    margin-bottom: 2px;
    color: #ffffff;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    color: #aaaaaa;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-requested {
    color: #888888;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-votes {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.vote-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #aaaaaa;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.vote-btn.voted {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
}

.vote-count {
    font-weight: bold;
    color: #ff0000;
    min-width: 24px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Playlists */
.playlists-list {
    margin-top: 20px;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.playlist-info h4 {
    margin-bottom: 5px;
    color: #ffffff;
    font-size: 1.1rem;
}

.playlist-info p {
    color: #aaaaaa;
    font-size: 0.9rem;
}

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

/* Queue Tab Styles */
.current-song-player {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 50px;
}

.current-song-player h2 {
    margin: 0;
    color: #ffffff;
    font-size: 0.9rem;
    min-width: 80px;
    flex-shrink: 0;
    font-weight: 600;
    display: none;
}

.queue-song-info .song-details {
    display: inline-block;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.queue-song-info .song-details img {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    display: inline-block;
}

.queue-song-info .song-text {
    flex: 1;
    min-width: 0;
    display: inline-block;
}

.queue-song-info .song-text h3 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.queue-song-info .song-text p {
    color: #aaaaaa;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-song-info .player-controls {
    display: inline-block;
    gap: 6px;
    flex-shrink: 0;
}

.queue-song-info .player-controls button {
    padding: 4px 8px;
    font-size: 0.8rem;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 10px;
}

.no-song-message {
    text-align: center;
    padding: 40px 20px;
}

.no-song-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-song-message p {
    color: #aaaaaa;
    margin-bottom: 10px;
}

.no-song-subtitle {
    font-size: 0.9rem;
    color: #888888;
}

.queue-list-section {
    margin-bottom: 25px;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.queue-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
}

.queue-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.queue-stats {
    color: #aaaaaa;
    font-size: 0.9rem;
}

.queue-search-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.queue-search-section h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1.1rem;
}

/* Enhanced Queue Items */
.queue-item {
    position: relative;
    transition: all 0.3s ease;
}

.queue-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.queue-item.playing {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.2), rgba(255, 107, 107, 0.2));
    border-color: #ff0000;
}

.queue-item.playing::before {
    content: "♪";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #ff0000;
    animation: pulse 2s infinite;
}

/* Clickable Queue Items for Hosts */
.clickable-queue-item {
    cursor: pointer;
    user-select: none;
}

.clickable-queue-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.clickable-queue-item:active {
    transform: translateY(-1px);
}

.playable-thumbnail {
    position: relative;
    transition: all 0.3s ease;
}

.playable-thumbnail::after {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.clickable-queue-item:hover .playable-thumbnail::after {
    opacity: 1;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Search Container */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-container input {
    flex: 1;
    margin-bottom: 0;
    min-width: 200px;
}

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

.modal-content {
    background: #1a1a1a;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    color: white;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: white;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.playlist-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.playlist-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
}

.playlist-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.playlist-option-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.playlist-option-text h3 {
    color: white;
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.playlist-option-text p {
    color: #888;
    margin: 0;
    font-size: 0.9rem;
}

.existing-playlists h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.playlist-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playlist-item-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.playlist-item-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.playlist-item-option h4 {
    color: white;
    margin: 0;
    font-size: 1rem;
}

.playlist-item-option p {
    color: #888;
    margin: 0;
    font-size: 0.8rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 12px 15px;
    }
    
    .app-header h1 {
        font-size: 1.3rem;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .create-party-section, .join-party-section {
        padding: 20px;
    }
    
    .party-controls-buttons {
        flex-direction: column;
    }
    
    .song-details {
        flex-direction: column;
        text-align: center;
    }
    
    .player-controls {
        flex-direction: column;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .queue-item {
        padding: 6px 8px;
        min-height: 45px;
        gap: 8px;
    }
    
    .queue-item-thumbnail {
        width: 35px;
        height: 35px;
    }
    
    .queue-item-title {
        font-size: 0.85rem;
    }
    
    .queue-item-artist {
        font-size: 0.75rem;
    }
    
    .queue-item-requested {
        font-size: 0.7rem;
    }
    
    .vote-btn {
        padding: 3px 6px;
        font-size: 0.8rem;
        min-width: 28px;
        height: 24px;
    }
    
    .playlist-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .playlist-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
    
    .nav-icon {
        font-size: 1.3rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 0, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 0, 0.7);
}

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

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

.queue-song-info .song-details img {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    display: block;
    margin: auto;
}

.queue-song-info .player-controls {
    display: inline-block;
    position: relative !important;
    top: -30px !important;
}

/* iOS WebView touch fixes */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields */
input, textarea {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Ensure buttons are touchable on iOS */
button, .btn, .clickable, .vote-btn, .queue-item, .search-result {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    touch-action: manipulation;
}

/* Fix for iOS WebView touch events */
.clickable-queue-item, .playable-thumbnail {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Visual feedback for touch events */
.touching {
    opacity: 0.7 !important;
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* Ensure proper touch targets for iOS */
.btn, .vote-btn, .queue-item, .search-result {
    min-height: 44px;
    min-width: 44px;
    position: relative;
}

/* Fix for iOS WebView button press states */
.btn:active, .vote-btn:active, .queue-item:active, .search-result:active {
    opacity: 0.7;
    transform: scale(0.98);
}