/* ==================== 
   CSS Variables 
   ==================== */
:root {
    --primary-color: #e74c3c;
    --secondary-color: #2c3e50;
    --accent-color: #f39c12;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ==================== 
   Reset & Base 
   ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 
   Header 
   ==================== */
.site-header {
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
}

.site-branding .logo h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 800;
}

.site-branding .logo span {
    color: var(--text-light);
    font-size: 0.9rem;
}

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.header-search form {
    display: flex;
    position: relative;
}

.header-search input[type="search"] {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: var(--transition);
}

.header-search input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.header-search button {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
}

.main-navigation {
    border-top: 1px solid #eee;
    padding: 10px 0;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
    justify-content: center;
}

.main-navigation a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
}

.main-navigation a:hover {
    color: var(--primary-color);
    background: rgba(231, 76, 60, 0.1);
}

.alphabet-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    overflow-x: auto;
    border-top: 1px solid #eee;
}

.alphabet-filter span {
    color: var(--text-light);
    white-space: nowrap;
}

.alphabet-filter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border-radius: 50%;
    font-weight: 600;
    transition: var(--transition);
}

.alphabet-filter a:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================== 
   Main Content 
   ==================== */
.site-main {
    padding: 40px 0;
}

.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
}

.hero-section h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--secondary-color);
    position: relative;
    padding-right: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ==================== 
   Song Cards Grid 
   ==================== */
.songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.song-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.song-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.song-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.song-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.song-card:hover .song-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.song-details {
    padding: 20px;
}

.song-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.song-artist {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.view-song {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==================== 
   Single Song Page 
   ==================== */
.song-single {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: var(--text-light);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary-color);
    padding: 5px 10px;
    background: rgba(231, 76, 60, 0.05);
    border-radius: 5px;
}

.breadcrumb a:hover {
    background: rgba(231, 76, 60, 0.1);
}

.song-header {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #eee;
    align-items: start;
}

.song-thumbnail img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.song-title {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.song-artists {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.artist-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(231, 76, 60, 0.1);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.artist-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.artist-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.song-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.meta-item {
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    font-style: normal;
}

.song-share {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: var(--transition);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ==================== 
   Audio Player Section
   ==================== */
.audio-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    color: white;
}

.audio-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-player-wrapper {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.audio-player-wrapper audio {
    width: 100%;
    margin-bottom: 15px;
}

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

.player-controls button {
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    background: white;
    color: var(--secondary-color);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.player-controls button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.download-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: white;
    color: var(--secondary-color);
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.download-btn span {
    font-size: 2rem;
}

.download-btn strong {
    display: block;
    font-size: 1.1rem;
}

.download-btn small {
    opacity: 0.7;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.download-btn.primary {
    background: var(--accent-color);
    color: white;
}

.copy-link-btn {
    padding: 12px 25px;
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.copy-link-btn:hover {
    background: white;
    color: var(--secondary-color);
}

/* ==================== 
   Video Section
   ==================== */
.video-section {
    margin-bottom: 30px;
}

.video-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.song-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: #000;
}

.song-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== 
   Lyrics Section
   ==================== */
.song-lyrics {
    background: #f9f9f9;
    padding: 40px;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.lyrics-header h2 {
    color: var(--secondary-color);
    font-size: 1.8rem;
}

.font-controls {
    display: flex;
    gap: 10px;
}

.font-controls button {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.font-controls button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.lyrics-content {
    font-size: 1.3rem;
    line-height: 2.8;
    text-align: center;
    color: var(--text-color);
    white-space: pre-line;
}

.copy-lyrics-btn {
    display: block;
    margin: 30px auto 0;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.copy-lyrics-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* ==================== 
   Artists Grid with Images
   ==================== */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.artist-card {
    background: var(--card-bg);
    padding: 25px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.artist-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.artist-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 4px solid #f0f0f0;
    transition: var(--transition);
}

.artist-card:hover .artist-image {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.artist-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.artist-avatar-default {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 800;
}

.artist-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--secondary-color);
    font-weight: 700;
}

.artist-card span {
    color: var(--text-light);
    font-size: 0.9rem;
    display: inline-block;
    background: #f8f9fa;
    padding: 5px 15px;
    border-radius: 20px;
}

/* ==================== 
   Artist Header Page
   ==================== */
.artist-header {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.artist-header-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--primary-color);
    flex-shrink: 0;
}

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

.artist-header-info h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.artist-header-info .songs-count {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 5px 20px;
    border-radius: 20px;
    font-weight: 600;
}

.artist-bio {
    margin-top: 15px;
    color: var(--text-light);
    line-height: 1.8;
    max-width: 600px;
}

.artist-social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.social-link.facebook { background: #1877f2; }
.social-link.instagram { 
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); 
}
.social-link.twitter { background: #1da1f2; }
.social-link.youtube { background: #ff0000; }

/* ==================== 
   Related Songs
   ==================== */
.related-songs {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.related-songs h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 25px;
    position: relative;
    padding-right: 15px;
}

.related-songs h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 25px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* ==================== 
   Archive Page
   ==================== */
.archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.archive-header h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

/* ==================== 
   Pagination
   ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* ==================== 
   Footer
   ==================== */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget li {
    margin-bottom: 10px;
}

.footer-widget a {
    opacity: 0.8;
}

.footer-widget a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* ==================== 
   AJAX Search Results
   ==================== */
#ajax-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 5px;
}

#ajax-search-results ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#ajax-search-results li {
    border-bottom: 1px solid #eee;
}

#ajax-search-results li:last-child {
    border-bottom: none;
}

#ajax-search-results a {
    display: block;
    padding: 15px 20px;
    transition: var(--transition);
}

#ajax-search-results a:hover {
    background: #f8f9fa;
}

#ajax-search-results strong {
    display: block;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

#ajax-search-results span {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ==================== 
   Responsive
   ==================== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 10px;
        display: none;
    }
    
    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .menu-toggle span {
        width: 25px;
        height: 3px;
        background: var(--secondary-color);
    }
    
    .alphabet-filter {
        padding: 10px 0;
    }
    
    .song-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .song-thumbnail {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .song-title {
        font-size: 1.8rem;
    }
    
    .song-artists,
    .song-meta {
        justify-content: center;
    }
    
    .artist-header {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    
    .artist-header-image {
        width: 120px;
        height: 120px;
    }
    
    .artist-social-links {
        justify-content: center;
    }
    
    .audio-section {
        padding: 20px;
    }
    
    .download-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .download-btn {
        justify-content: center;
    }
    
    .songs-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .hero-section h2 {
        font-size: 1.8rem;
    }
    
    .lyrics-content {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .songs-grid {
        grid-template-columns: 1fr;
    }
    
    .song-single {
        padding: 20px;
    }
    
    .song-lyrics {
        padding: 20px;
    }
    
    .artists-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 
   Print Styles
   ==================== */
@media print {
    .site-header,
    .site-footer,
    .audio-section,
    .video-section,
    .song-share,
    .related-songs,
    .alphabet-filter,
    .copy-lyrics-btn {
        display: none !important;
    }
    
    .song-single {
        box-shadow: none;
        padding: 0;
    }
    
    .song-lyrics {
        background: none;
        page-break-inside: avoid;
    }
}