/* ========================================
   main.css 
   ======================================== */

@import url('base.css');
@import url('header.css');
@import url('footer.css');
@import url('home.css');
@import url('lyrics.css');
@import url('artist.css');
@import url('search.css');
@import url('modal.css');
@import url('responsive.css');

/* ========================================
   Ad Formats
   ======================================== */

/* Generic Styles for Ad Containers */
.ad-container {
    margin: 20px 0;
    text-align: center;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-secondary);
    padding: 10px 0;
}

.ad-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Ad Items in the Homepage List */
.track-list-item.ad-item {
    display: block;
    padding: 15px 20px;
    cursor: default;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin: 10px 0;
}

.track-list-item.ad-item:hover {
    background: var(--bg-secondary);
    transform: none;
}

.ad-wrapper {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom Advertisement */
.bottom-ad {
    margin: 30px 0 20px;
    padding: 15px 0;
    background: var(--bg-secondary);
    border-radius: 16px;
}

/* Lyrics Page Ad */
.lyrics-ad {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 16px;
}

.related-ad {
    max-width: 800px;
    margin: 20px auto 30px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 16px;
}

/* Artist Page Ads */
.artist-top-ad,
.artist-bottom-ad {
    max-width: 900px;
    margin: 20px auto;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 16px;
}

.artist-ad-item {
    padding: 15px;
    margin: 15px 0;
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

/* Responsive Adjustment */
@media (max-width: 768px) {
    .ad-container {
        margin: 15px 0;
    }
    
    .track-list-item.ad-item {
        padding: 10px;
    }
    
    .lyrics-ad,
    .related-ad,
    .artist-top-ad,
    .artist-bottom-ad {
        margin: 15px auto;
        padding: 10px;
    }
    
    .ad-wrapper {
        min-height: 70px;
    }
}

@media (max-width: 480px) {
    .ad-container {
        margin: 12px 0;
    }
    
    .ad-label {
        font-size: 0.6rem;
    }
}

/* Ad Borders in Dark Mode */
[data-theme="dark"] .ad-container {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .track-list-item.ad-item {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .artist-ad-item {
    background: var(--bg-secondary);
}

/* ========================================
   Music Grid Style (3x3)
   ======================================== */

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.music-grid-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
}

.music-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.music-grid-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.music-grid-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.music-grid-item:hover .music-grid-cover img {
    transform: scale(1.05);
}

/* Type Tag Badge */
.music-grid-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-sm);
}

.badge-album {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.badge-track {
    background: linear-gradient(135deg, #e1306c, #c41e5a);
    color: white;
}

.music-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 3;
}

.music-grid-item:hover .music-grid-overlay {
    opacity: 1;
}

.music-grid-play {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    transition: transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-grid-play:hover {
    transform: scale(1.1);
    background: var(--accent-hover);
}

.music-grid-info {
    padding: 12px;
}

.music-grid-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.music-grid-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-grid-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.music-grid-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.music-grid-actions {
    padding: 0 12px 12px 12px;
}

.grid-lyrics-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.grid-lyrics-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.scroll-to-top:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
}

/* Search Highlight */
.search-highlight {
    background: var(--accent-color);
    color: white;
    padding: 0 2px;
    border-radius: 3px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}