/*
Theme Name: Quran MP3
Description: A beautiful and functional WordPress theme for Quran MP3 websites, featuring three-column layout with languages and reciters navigation, audio players, and comprehensive customization options. Perfect for Islamic audio content websites.
Version: 1.0.0
Author: Manus AI
Author URI: https://manus.ai
Text Domain: quran-mp3
Domain Path: /languages
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, custom-background, custom-colors, custom-header, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, two-columns, accessibility-ready
*/

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Default Color Scheme - Customizable via WordPress Customizer */
    --primary-color: #4a5568;
    --secondary-color: #2d3748;
    --accent-color: #3182ce;
    --background-color: #f7fafc;
    --text-color: #2d3748;
    --sidebar-bg: #2d3748;
    --sidebar-text: #e2e8f0;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --hover-color: #4299e1;
    
    /* Typography - Customizable */
    --primary-font: 'Arial', sans-serif;
    --heading-font: 'Georgia', serif;
    --arabic-font: 'Amiri', 'Times New Roman', serif;
    
    /* Spacing */
    --container-max-width: 1200px;
    --sidebar-width: 250px;
    --content-padding: 20px;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--primary-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    direction: ltr;
}

/* RTL Support */
body.rtl {
    direction: rtl;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.site-title:hover {
    color: var(--accent-color);
}

.site-description {
    color: var(--text-color);
    font-size: 1rem;
    margin-top: 5px;
}

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

.feedback-link {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.feedback-link:hover {
    background-color: var(--hover-color);
}

/* Three-Column Layout */
.main-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
    gap: 20px;
    margin: 20px 0;
    min-height: calc(100vh - 200px);
}

/* Left Sidebar - Languages */
.languages-sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-radius: var(--border-radius);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: var(--sidebar-text);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.alphabet-section {
    margin-bottom: 20px;
}

.alphabet-letter {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.language-list,
.reciter-list {
    list-style: none;
    margin-bottom: 15px;
}

.language-list li,
.reciter-list li {
    margin-bottom: 8px;
}

.language-list a,
.reciter-list a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 5px 10px;
    display: block;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.language-list a:hover,
.reciter-list a:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateX(5px);
}

/* Right Sidebar - Reciters */
.reciters-sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-radius: var(--border-radius);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 120px;
}

/* Main Content Area */
.main-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
}

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.welcome-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
}

/* Social Media Profiles */
.social-profiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.social-profile {
    background-color: var(--background-color);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    text-align: center;
}

.social-profile h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.profile-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.profile-details h4 {
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.profile-handle {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.stat {
    text-align: center;
}

.stat-number {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

.social-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.social-button:hover {
    background-color: var(--hover-color);
}

.facebook-button {
    background-color: #4267B2;
}

.facebook-button:hover {
    background-color: #365899;
}

/* Statistics Section */
.statistics-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    margin: 40px 0;
    text-align: center;
}

.statistics-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.stat-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.stat-item h3 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-weight: bold;
}

.stat-item p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* App Downloads Section */
.app-downloads {
    margin: 40px 0;
}

.app-downloads h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.app-item {
    text-align: center;
    padding: 25px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.app-item h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.app-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.download-button {
    display: inline-block;
    background-color: #27ae60;
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.download-button:hover {
    background-color: #229954;
}

/* Location Section */
.location-section {
    text-align: center;
    margin: 40px 0;
    padding: 25px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.location-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.location-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.location-link:hover {
    text-decoration: underline;
}

/* Surah Cards for Language/Reciter Pages */
.surahs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.surah-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.surah-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.surah-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: bold;
}

.surah-title-arabic {
    font-family: var(--arabic-font);
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-align: right;
}

.surah-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.audio-player {
    margin: 15px 0;
}

.audio-player audio {
    width: 100%;
    height: 40px;
}

.surah-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.download-btn {
    background-color: var(--accent-color);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: var(--hover-color);
}

.download-count {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* Page Headers */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: var(--border-radius);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Footer */
.site-footer {
    background-color: var(--secondary-color);
    color: var(--sidebar-text);
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

.footer-content p {
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 200px 1fr 200px;
    }
    
    :root {
        --sidebar-width: 200px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .languages-sidebar,
    .reciters-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .social-profiles {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .app-grid {
        grid-template-columns: 1fr;
    }
    
    .surahs-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --content-padding: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .surah-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-color: #000000;
        --background-color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}



/* Enhanced Header Styles */
.header-elements-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

.header-logo .custom-logo-link {
    display: inline-block;
}

.header-navigation .main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-navigation .main-navigation ul li {
    margin: 0 10px;
}

.header-navigation .main-navigation a {
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-navigation .main-navigation a:hover {
    background-color: var(--accent-color);
    color: white;
}

.header-button-container .header-button {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

/* Mobile Header Styles */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle.active {
    background-color: var(--accent-color);
    color: white;
}

.mobile-logo {
    flex: 1;
    text-align: center;
}

.mobile-logo .custom-logo-link img {
    max-height: 40px;
    width: auto;
}

.mobile-menu-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 20px;
    z-index: 1000;
}

.mobile-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-navigation ul li {
    margin-bottom: 10px;
}

.mobile-navigation a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-navigation a:hover {
    background-color: var(--accent-color);
    color: white;
}

.mobile-social {
    margin: 20px 0;
    text-align: center;
}

.mobile-button {
    text-align: center;
    margin-top: 15px;
}

/* Desktop/Mobile Toggle */
@media (max-width: 768px) {
    .desktop-header {
        display: none;
    }
    
    .mobile-header {
        display: flex;
    }
}

@media (min-width: 769px) {
    .desktop-header {
        display: block;
    }
    
    .mobile-header {
        display: none;
    }
}

/* Header Scroll Effects */
.site-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.site-header.header-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

/* Enhanced Audio Player Styles */
.surah-card.playing {
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px rgba(49, 130, 206, 0.2);
}

.surah-card.playing .surah-title {
    color: var(--accent-color);
}

/* Form Error Styles */
.error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

/* Print Styles */
@media print {
    .site-header,
    .mobile-header,
    .mobile-menu-content,
    .header-actions,
    .social-profiles,
    .app-downloads {
        display: none !important;
    }
    
    .main-content {
        box-shadow: none;
        border: none;
    }
}

/* High Contrast Mode Enhancements */
@media (prefers-contrast: high) {
    .mobile-menu-toggle {
        border: 2px solid currentColor;
    }
    
    .header-button,
    .feedback-link {
        border: 2px solid currentColor;
    }
}

/* Focus Styles for Better Accessibility */
.mobile-menu-toggle:focus,
.header-button:focus,
.feedback-link:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Custom Logo Sizing */
.custom-logo {
    transition: all 0.3s ease;
}

/* Header Layout Variations */
.header-layout-centered .header-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
}

.header-layout-minimal .site-branding {
    font-size: 0.9em;
}

.header-layout-minimal .header-actions {
    gap: 10px;
}

/* Social Media Icons Styling */
.header-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.header-social a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Improvements */
@media (max-width: 480px) {
    .mobile-logo .site-title {
        font-size: 1.5rem;
    }
    
    .mobile-menu-content {
        padding: 15px;
    }
    
    .mobile-navigation a {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

