/* Quran Listening Styles - Cleaned and Optimized */

/* Hero Section */
.quran-hero {
    background: linear-gradient(135deg, #ad5207 0%, #e88e07 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quran-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
}

.quran-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
    position: relative;
    z-index: 1;
}

.quran-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Player Section */
.player-section {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: -3rem auto 0;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.current-playing {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f3f4f6;
}

.surah-info h2 {
    color: #ad5207;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.surah-arabic {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 2rem;
    color: #374151;
    margin: 0.5rem 0;
    direction: rtl;
}

h2.surah-arabic {
    color: #ad5207;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.reciter-info {
    color: #6b7280;
    font-size: 1rem;
}

/* Audio Player */
.audio-player {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.control-btn {
    background: #ad5207;
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.control-btn:hover {
    background: #e88e07;
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.play-pause {
    width: 4rem;
    height: 4rem;
    font-size: 1.5rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.time-display {
    font-family: monospace;
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #ad5207;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.volume-slider {
    width: 100px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ad5207;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ad5207;
    cursor: pointer;
    border: none;
}

/* Selection Controls */
.selection-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-group {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
}

.control-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.control-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    color: #374151;
    font-size: 1rem;
}

.control-group select:focus {
    outline: none;
    border-color: #ad5207;
    box-shadow: 0 0 0 2px rgba(173, 82, 7, 0.2);
}

#surah-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    appearance: none;
    padding-right: 2.5rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: 2px solid #ad5207;
    border-radius: 0.5rem;
    background: white;
    color: #ad5207;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.action-btn:hover:not(:disabled) {
    background: #ad5207;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(173, 82, 7, 0.3);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #d1d5db;
    color: #9ca3af;
}

.action-btn:disabled:hover {
    background: white;
    color: #9ca3af;
    transform: none;
    box-shadow: none;
}

.read-btn {
    border-color: #059669;
    color: #059669;
}

.read-btn:hover:not(:disabled) {
    background: #059669;
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.download-btn {
    border-color: #7c3aed;
    color: #7c3aed;
}

.download-btn:hover:not(:disabled) {
    background: #7c3aed;
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Surah Information Section */
.surah-info-section {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.info-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.info-container h2 {
    color: #ad5207;
    margin-bottom: 2rem;
    font-size: 1.875rem;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: #ad5207;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
}

.info-card h3 i {
    color: #ad5207;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #374151;
}

.info-value {
    font-weight: 600;
    color: #1f2937;
}

.arabic-text {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 1.125rem;
    direction: rtl;
}

.surah-summary {
    line-height: 1.6;
    color: #4b5563;
}

.themes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.theme-tag {
    background: #fef3e7;
    color: #ad5207;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #fed7aa;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ad5207;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Related Surahs Section */
.related-section {
    margin-top: 2rem;
    border-top: 2px solid #f3f4f6;
    padding-top: 2rem;
}

.related-section h3 {
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-section h3 i {
    color: #ad5207;
}

.related-surahs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.related-surah-card {
    background: #fef3e7;
    border: 1px solid #fed7aa;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.related-surah-card:hover {
    background: #fde68a;
    border-color: #f59e0b;
    transform: translateY(-2px);
}

.related-surah-number {
    background: #ad5207;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0 auto 0.5rem;
}

.related-surah-name {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.25rem;
}

.related-surah-arabic {
    font-family: 'Noto Sans Arabic', sans-serif;
    color: #451a03;
    direction: rtl;
}

/* Loading Animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
}

.loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #ad5207;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus states for accessibility */
.control-btn:focus,
.control-group select:focus {
    outline: 2px solid #ad5207;
    outline-offset: 2px;
}

.progress-bar:focus {
    outline: 2px solid #ad5207;
}

/* Hide default audio controls */
audio {
    display: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .quran-hero {
        padding: 2.5rem 1rem;
    }

    .quran-hero h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .quran-hero p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .player-section {
        margin: -1.5rem 0.5rem 0;
        padding: 1rem;
        border-radius: 0.75rem;
    }

    .current-playing {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .surah-info h2 {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }

    .surah-arabic,
    h2.surah-arabic {
        font-size: 1.5rem;
        margin: 0.25rem 0;
    }

    .reciter-info {
        font-size: 0.875rem;
    }

    .audio-player {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .player-controls {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .control-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }

    .control-btn.play-pause {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    .progress-container {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .progress-bar {
        height: 8px;
        border-radius: 4px;
    }

    .progress-fill {
        border-radius: 4px;
    }

    .time-display {
        font-size: 0.75rem;
        min-width: 35px;
        text-align: center;
    }

    .volume-container {
        justify-content: center;
        gap: 0.75rem;
    }

    .volume-container i {
        font-size: 0.875rem;
    }

    .volume-slider {
        width: 80px;
    }

    .selection-controls {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .control-group {
        padding: 0.75rem;
    }

    .control-group label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .control-group select {
        padding: 0.625rem;
        font-size: 0.875rem;
        border-radius: 0.25rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .action-btn {
        padding: 0.625rem;
        font-size: 0.75rem;
        gap: 0.375rem;
    }

    .surah-info-section {
        margin-top: 1.5rem;
    }

    .info-container {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    .info-container h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .info-card {
        padding: 1rem;
    }

    .info-card h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem 0;
    }

    .info-value {
        font-size: 0.875rem;
    }

    .arabic-text {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-item {
        padding: 0.75rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .related-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .related-section h3 {
        font-size: 1rem;
    }

    .related-surahs {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .related-surah-card {
        padding: 0.75rem;
    }

    .related-surah-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }

    .related-surah-name {
        font-size: 0.875rem;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .quran-hero {
        padding: 2rem 0.75rem;
    }

    .quran-hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .quran-hero p {
        font-size: 0.875rem;
    }

    .player-section {
        margin: -1rem 0.25rem 0;
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .control-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }

    .control-btn.play-pause {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }

    .progress-bar {
        height: 6px;
        border-radius: 3px;
    }

    .progress-fill {
        border-radius: 3px;
    }

    .time-display {
        font-size: 0.7rem;
        min-width: 30px;
    }

    .volume-container {
        gap: 0.5rem;
    }

    .volume-container i {
        font-size: 0.75rem;
    }

    .volume-slider {
        width: 60px;
        height: 3px;
    }

    .action-buttons {
        gap: 0.5rem;
    }

    .action-btn {
        padding: 0.625rem;
        font-size: 0.75rem;
        gap: 0.375rem;
    }
}