/* Basic styles for Collaborative Jukebox */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

header {
    background-color: #2d2d2d;
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid #4a4a4a;
}

header h1 {
    color: #ff6b6b;
    font-size: 2rem;
}

#main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.container {
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #ff5252;
}

button:disabled {
    background-color: #666;
    cursor: not-allowed;
}

input, select {
    background-color: #3d3d3d;
    color: white;
    border: 1px solid #555;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.queue-item {
    background-color: #3d3d3d;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.now-playing {
    border-left: 4px solid #ff6b6b;
}

.error {
    background-color: #ff4444;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success {
    background-color: #44ff44;
    color: black;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.info {
    background-color: #4a90e2;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.loading {
    color: #ccc;
    font-style: italic;
}

/* Host Interface Styles */
.host-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.host-interface .container {
    margin-bottom: 0;
}

.room-info {
    grid-column: 1 / -1;
}

.room-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 2rem;
    margin-top: 1rem;
}

.qr-section {
    text-align: center;
}

.qr-code {
    max-width: 200px;
    height: auto;
    border: 2px solid #4a4a4a;
    border-radius: 8px;
}

.share-links {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.share-links input {
    flex: 1;
    margin-bottom: 0;
}

.participants-section h3 {
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.participant {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #3d3d3d;
    border-radius: 4px;
}

.participant.host {
    border-left: 3px solid #ff6b6b;
}

.participant .name {
    font-weight: bold;
}

.participant .joined-time {
    font-size: 0.8rem;
    color: #ccc;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.connection-status.connected {
    background-color: #2d5a2d;
    color: #90ee90;
}

.connection-status.disconnected {
    background-color: #5a2d2d;
    color: #ff9090;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Now Playing Styles */
.now-playing {
    grid-column: 1;
}

.song-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.album-art {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.song-details {
    flex: 1;
}

.song-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.song-artist {
    color: #ccc;
    margin-bottom: 0.25rem;
}

.song-platform {
    font-size: 0.8rem;
    color: #ff6b6b;
    text-transform: uppercase;
}

.no-song {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-style: italic;
}

.progress-bar {
    position: relative;
    height: 6px;
    background-color: #3d3d3d;
    border-radius: 3px;
    margin: 1rem 0;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background-color: #ff6b6b;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #ccc;
    margin-top: 0.5rem;
}

/* Playback Controls Styles */
.playback-controls {
    grid-column: 2;
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 0.5rem;
    margin-bottom: 1rem;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    font-size: 0.9rem;
    min-height: 80px;
}

.control-btn .icon {
    font-size: 1.5rem;
}

.control-btn.danger {
    background-color: #cc4444;
}

.control-btn.danger:hover {
    background-color: #aa3333;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-control label {
    color: #ccc;
    font-size: 0.9rem;
}

.volume-control input[type="range"] {
    flex: 1;
    margin: 0;
}

#volume-display {
    font-size: 0.9rem;
    color: #ccc;
    min-width: 40px;
}

/* Queue Styles */
.queue-section {
    grid-column: 1 / -1;
}

.queue-container {
    max-height: 400px;
    overflow-y: auto;
}

.empty-queue {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-style: italic;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #3d3d3d;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.queue-item:hover {
    background-color: #4a4a4a;
}

.queue-position {
    font-weight: bold;
    color: #ff6b6b;
    min-width: 30px;
    text-align: center;
}

.queue-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.queue-song-info {
    flex: 1;
}

.queue-song-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.queue-song-artist {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.queue-song-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.platform {
    color: #ff6b6b;
    text-transform: uppercase;
}

.radio-tag {
    background-color: #4a90e2;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

.added-by {
    color: #ccc;
}

.queue-duration {
    color: #ccc;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-weight: bold;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.button-group button {
    flex: 1;
}

.button-group .primary {
    background-color: #ff6b6b;
}

.button-group .secondary {
    background-color: #666;
}

.status-message {
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .host-interface {
        grid-template-columns: 1fr;
    }
    
    .room-details {
        grid-template-columns: 1fr;
        grid-gap: 1rem;
    }
    
    .control-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .queue-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .song-info {
        flex-direction: column;
        text-align: center;
    }
}/*
 Participant Interface Styles */
.participant-interface {
    max-width: 1200px;
    margin: 0 auto;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2d2d2d;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.room-header h2 {
    color: #ff6b6b;
    margin: 0;
}

.participant-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 1rem;
}

.now-playing-section,
.music-search-section,
.queue-section,
.participants-section {
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.now-playing-section {
    grid-column: 1 / -1;
}

.now-playing-card {
    background-color: #3d3d3d;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #ff6b6b;
}

.now-playing-card .song-info {
    margin-bottom: 1rem;
}

.now-playing-card .song-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.now-playing-card .song-artist {
    color: #ccc;
    font-size: 1rem;
}

.music-search-section {
    grid-column: 1;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-container input {
    flex: 1;
    margin-bottom: 0;
}

.platform-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.platform-filters label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
}

.platform-filters input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #3d3d3d;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #4a4a4a;
}

.search-result-item .song-thumbnail {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.search-result-item .song-thumbnail img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}

.search-result-item .song-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .song-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .song-artist {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .song-platform {
    font-size: 0.8rem;
    color: #ff6b6b;
    text-transform: uppercase;
}

.add-song-btn {
    background-color: #4a90e2;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.add-song-btn:hover {
    background-color: #357abd;
}

.no-results {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-style: italic;
}

.search-status {
    text-align: center;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.search-status.info {
    background-color: #4a90e2;
    color: white;
}

.search-status.error {
    background-color: #ff4444;
    color: white;
}

.queue-section {
    grid-column: 2;
}

.queue-list {
    max-height: 400px;
    overflow-y: auto;
}

.queue-list .queue-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #3d3d3d;
    border-radius: 4px;
}

.queue-list .queue-position {
    font-weight: bold;
    color: #ff6b6b;
    min-width: 30px;
    text-align: center;
}

.queue-list .song-thumbnail {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.queue-list .song-thumbnail img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}

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

.queue-list .song-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-list .song-artist {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-list .song-meta {
    font-size: 0.8rem;
    color: #999;
}

.participants-section {
    grid-column: 1 / -1;
}

.participants-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 0.5rem;
}

.participant-item {
    background-color: #3d3d3d;
    padding: 1rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.participant-name {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.host-badge {
    background-color: #ff6b6b;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.participant-joined {
    font-size: 0.8rem;
    color: #ccc;
}

.join-room-form {
    max-width: 400px;
    margin: 0 auto;
}

.qr-scanner-section {
    text-align: center;
    border-top: 1px solid #4a4a4a;
    padding-top: 2rem;
}

.qr-scanner-section h3 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

#qr-scanner {
    background-color: #3d3d3d;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Responsive Design for Participant Interface */
@media (max-width: 768px) {
    .participant-content {
        grid-template-columns: 1fr;
    }
    
    .music-search-section,
    .queue-section {
        grid-column: 1;
    }
    
    .room-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .platform-filters {
        justify-content: center;
    }
    
    .search-result-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .search-result-item .song-info {
        text-align: center;
    }
    
    .participants-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .participant-content {
        grid-gap: 0.5rem;
    }
    
    .now-playing-section,
    .music-search-section,
    .queue-section,
    .participants-section {
        padding: 1rem;
    }
    
    .room-header {
        padding: 0.75rem;
    }
    
    .search-result-item,
    .queue-item {
        padding: 0.5rem;
    }
}

/* Error Handling Styles */
.error-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    width: 100%;
}

.error-message {
    background-color: #2d2d2d;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.error-message.error-removing {
    animation: slideOut 0.3s ease-in;
    opacity: 0;
    transform: translateX(100%);
}

.error-message.error-error {
    border-left: 4px solid #ff4444;
}

.error-message.error-warning {
    border-left: 4px solid #ffaa44;
}

.error-message.error-info {
    border-left: 4px solid #4a90e2;
}

.error-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.error-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.error-text {
    flex: 1;
    min-width: 0;
}

.error-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
    color: #ffffff;
}

.error-message-text {
    font-size: 13px;
    color: #cccccc;
    line-height: 1.4;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.retry-btn, .close-btn {
    background: none;
    border: 1px solid #666;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background-color: #4a90e2;
    border-color: #4a90e2;
}

.close-btn {
    background-color: transparent;
    border: none;
    color: #999;
    padding: 4px 8px;
    font-size: 16px;
    font-weight: bold;
}

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

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

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

/* Network Status Indicator */
.network-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
}

.network-status.online {
    border-left: 4px solid #44ff44;
}

.network-status.offline {
    border-left: 4px solid #ff4444;
}

.network-status.reconnecting {
    border-left: 4px solid #ffaa44;
}

.network-status-icon {
    font-size: 16px;
}

.network-status-text {
    font-size: 13px;
    color: #cccccc;
}

.network-status-details {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #ffffff;
    margin-top: 16px;
    text-align: center;
}

/* Retry Button Styles */
.retry-section {
    text-align: center;
    padding: 2rem;
    background-color: #2d2d2d;
    border-radius: 8px;
    margin: 1rem 0;
}

.retry-section h3 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.retry-section p {
    color: #cccccc;
    margin-bottom: 1.5rem;
}

.retry-section .retry-btn {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.retry-section .retry-btn:hover {
    background-color: #357abd;
}

/* Mobile Error Styles */
@media (max-width: 768px) {
    .error-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .error-content {
        padding: 12px;
        gap: 8px;
    }
    
    .error-actions {
        flex-direction: row;
        gap: 6px;
    }
    
    .network-status {
        bottom: 10px;
        left: 10px;
        right: 10px;
        justify-content: center;
    }
}