/* HomeEnhanced Component Styles */
.home-enhanced {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loading State */
.home-enhanced.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loading-spinner {
    text-align: center;
    color: var(--text-primary, #fff);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Background */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.background-image.active {
    opacity: 1;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
}

/* Content */
.content-container {
    position: relative;
    z-index: 1;
    padding: 20px;
    color: white;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 60px;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.welcome-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Quick Access */
.quick-access {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.quick-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

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

.quick-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.see-all-button,
.refresh-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.see-all-button:hover,
.refresh-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Daily Mixes */
.daily-mixes-section {
    margin-bottom: 40px;
}

.daily-mixes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.mix-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mix-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.mix-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    aspect-ratio: 1;
}

.mix-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mix-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 2rem;
    color: white;
}

.mix-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.mix-info p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

.mix-hint {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
    margin: 0;
}

/* Horizontal Scrolling Sections */
.horizontal-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.track-card,
.recommendation-card {
    flex: 0 0 160px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.track-card:hover,
.recommendation-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.track-image {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    aspect-ratio: 1;
}

.track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info .reason {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

/* Mix Queue Overlay */
.mix-queue-overlay {
    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;
    padding: 20px;
}

.mix-queue-modal {
    background: var(--bg-secondary, #2a2a2a);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    color: white;
}

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

.queue-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.queue-tracks {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.queue-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.queue-track:last-child {
    border-bottom: none;
}

.track-number {
    font-size: 0.9rem;
    opacity: 0.6;
    min-width: 20px;
}

.queue-track img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

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

.track-name {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-more {
    text-align: center;
    padding: 16px;
    opacity: 0.6;
    font-size: 0.9rem;
}

.queue-actions {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.play-queue-button {
    width: 100%;
    background: var(--accent-color, #007bff);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.play-queue-button:hover {
    background: var(--accent-hover, #0056b3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-container {
        padding: 16px;
    }
    
    .welcome-section {
        padding-top: 40px;
        margin-bottom: 30px;
    }
    
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    .quick-access {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .quick-button {
        padding: 16px 12px;
    }
    
    .daily-mixes {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .track-card,
    .recommendation-card {
        flex: 0 0 140px;
    }
    
    .mix-queue-modal {
        margin: 0;
        max-height: 90vh;
    }
}

/* iOS Scroll Fix */
.horizontal-scroll {
    -webkit-overflow-scrolling: touch;
    transform: translate3d(0, 0, 0);
}

/* Smooth scrolling for the entire component */
.home-enhanced {
    -webkit-overflow-scrolling: touch;
    transform: translate3d(0, 0, 0);
}
