:root {
    --primary: #4c956c;
    --primary-dark: #2c6e49;
    --secondary: #fefee3;
    --accent: #d68c45;
    --text: #2a2a2a;
    --bg-light: #f8f9fa;
    --border: #dee2e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
}

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

header {
    background-color: var(--primary);
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-image: linear-gradient(to right, var(--primary), var(--primary-dark));
}

/* Add this to your CSS to ensure toggle buttons are always visible */
.toggle-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.8); /* Slightly dimmed white for inactive */
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.toggle-btn.active {
    color: var(--primary-dark); /* Dark color for active button */
    font-weight: bold;
}

/* Non-active button should still be visible but dimmed */
.toggle-btn:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

.language-toggle {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.toggle-container {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: inline-flex;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

/* Dark text for the active button (on white background) */
.toggle-btn.active {
    color: var(--primary-dark);
    font-weight: bold;
}

/* Light text for the inactive button when slider is in English position */
.toggle-slider:not(.rtl) ~ .toggle-btn:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

/* Dark text for the inactive button when slider is in Arabic position */
.toggle-slider.rtl ~ .toggle-btn:not(.active) {
    color: rgba(0, 0, 0, 0.7);
}

.toggle-slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background-color: white;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.toggle-slider.rtl {
    transform: translateX(100%);
}

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

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
}

.content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.sidebar {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.main-content {
    flex: 2;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

h2 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.reciter-list {
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
}

.reciter-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-light);
}

.reciter-item:hover {
    background-color: var(--secondary);
}

.reciter-item.active {
    background-color: var(--primary);
    color: white;
}

/* Surah list styles */
.surah-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.surah-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 3px solid transparent;
    transition: all 0.2s ease, border-left-color 0.2s ease;
}

.surah-item:hover {
    background-color: var(--secondary);
    border-left-color: var(--primary);
}

.surah-number {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 0.9rem;
}

.surah-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.surah-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.surah-meaning {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

body:not(.rtl) .surah-item-name {
    text-align: left;
    direction: ltr;
}

body.rtl .surah-item-name {
    text-align: right;
    direction: rtl;
    font-family: 'Traditional Arabic', 'Scheherazade New', serif;
}

.surah-item .play-icon {
    color: var(--primary);
    font-size: 1rem;
    margin-left: 10px;
}

.surah-item:hover .play-icon {
    color: var(--accent);
}

/* RTL support for surah list */
body.rtl .surah-number {
    margin-right: 0;
    margin-left: 10px;
}

body.rtl .surah-item {
    border-left: none;
    border-right: 3px solid transparent;
}

body.rtl .surah-item:hover {
    border-right-color: var(--primary);
}

/* Make player smaller on mobile */
@media (max-width: 768px) {
    .player-container:not(.minimized) {
        padding: 8px;
    }
    
    .player-container.minimized {
        transform: translateY(calc(100% - 50px));
    }
    
    .player-title {
        font-size: 0.9rem;
        max-width: 150px;
    }
    
    .player-subtitle {
        font-size: 0.8rem;
    }
    
    .player-btn {
        font-size: 1.2rem;
    }
    
    .play-pause-btn {
        width: 32px;
        height: 32px;
    }
}

.surah-card {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.surah-card:hover {
    background-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.surah-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.arabic-name {
    font-family: 'Traditional Arabic', 'Scheherazade New', serif;
    direction: rtl;
    font-size: 1.3rem;
    margin-top: 5px;
}

.surah-number {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.surah-card .play-icon {
    color: var(--primary);
    font-size: 1.5rem;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.surah-card:hover .play-icon {
    color: var(--accent);
    transform: scale(1.2);
}

.player-container {
    background-color: var(--primary-dark);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    color: white;
    display: none;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: transform 0.3s ease;
}

.player-container.minimized {
    transform: translateY(calc(100% - 60px));
}

.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.player-actions {
    display: flex;
    gap: 15px;
}

.player-action-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.player-action-btn:hover {
    opacity: 1;
}

.player-info {
    flex: 1;
}

.player-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.player-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-container {
    flex: 2;
    margin: 0 20px;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    position: relative;
    cursor: pointer;
}

.progress {
    height: 100%;
    background-color: white;
    border-radius: 5px;
    width: 0;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-top: 5px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-message i {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
    opacity: 0.8;
}

.welcome-message h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.welcome-message p {
    color: var(--text);
    max-width: 600px;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary);
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

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

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

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

body.rtl .sidebar {
    order: 2;
}

body.rtl .main-content {
    order: 1;
}

@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    
    .player-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .player-controls {
        width: 100%;
        justify-content: center;
    }
    
    .progress-container {
        width: 100%;
        margin: 10px 0;
    }
    
    /* Compact mobile player */
    .player-container:not(.minimized) {
        padding: 10px;
    }
    
    .player-container.minimized .player-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .player-container.minimized .progress-container,
    .player-container.minimized .player-subtitle,
    .player-container.minimized .player-controls {
        display: none;
    }
    
    .player-container.minimized .player-content {
        flex-direction: row;
    }
    
    .player-container.minimized .play-pause-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .player-container.minimized .player-title {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
}