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

body {
    font-family: 'Tajawal', sans-serif;
    background: #f5f3ed;
    min-height: 100vh;
    padding: 20px;
    color: #2c3e50;
}

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

.header {
    background: white;
    border: 3px solid #1b5e20;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.arabic-title {
    font-family: 'Amiri', serif;
    font-size: 3em;
    color: #1b5e20;
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.5;
}

h1 {
    color: #1b5e20;
    margin-bottom: 15px;
    font-size: 2em;
    font-weight: 600;
}

.date-info {
    color: #555;
    font-size: 1.1em;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hijri-date {
    font-family: 'Amiri', serif;
    font-size: 1.5em;
    color: #1b5e20;
    font-weight: 700;
    direction: rtl;
}

.navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 5px 0;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: white;
    border: 2px solid #1b5e20;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    font-family: 'Tajawal', sans-serif;
    color: #1b5e20;
}

.nav-btn:hover {
    background: #e8f5e9;
}

.nav-btn.active {
    background: #1b5e20;
    color: white;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.location-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.location-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 15px;
}

input[type="text"], input[type="number"], select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: 'Tajawal', sans-serif;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #1b5e20;
}

input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #1b5e20;
}

button {
    background: #1b5e20;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s;
    font-family: 'Tajawal', sans-serif;
}

button:hover {
    background: #2e7d32;
}

.geolocation-btn {
    width: 100%;
    margin-top: 10px;
    background: #00695c;
}

.geolocation-btn:hover {
    background: #00897b;
}

.prayer-times {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.prayer-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #e0e0e0;
}

.prayer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prayer-card.current {
    background: #1b5e20;
    color: white;
    border-color: #1b5e20;
}

.prayer-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prayer-name-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.6em;
    margin-bottom: 8px;
    font-weight: 600;
}

.prayer-time {
    font-size: 1.8em;
    font-weight: 700;
}

.next-prayer {
    background: #00695c;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.countdown {
    font-size: 2em;
    font-weight: 700;
    margin-top: 10px;
}

.quran-section, .hadith-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.surah-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.surah-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
}

.surah-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #1b5e20;
}

.surah-name {
    font-family: 'Amiri', serif;
    font-size: 1.8em;
    color: #1b5e20;
    margin-bottom: 8px;
    direction: rtl;
    font-weight: 600;
}

.surah-translation {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.surah-info {
    font-size: 0.9em;
    color: #777;
}

.verse {
    background: #fafafa;
    padding: 25px;
    margin: 15px 0;
    border-radius: 8px;
    border-right: 4px solid #1b5e20;
}

.verse-arabic {
    font-family: 'Amiri', serif;
    font-size: 2em;
    line-height: 2.5;
    color: #1b5e20;
    text-align: right;
    direction: rtl;
    margin-bottom: 20px;
}

.verse-translation {
    font-size: 1.1em;
    color: #555;
    line-height: 1.8;
    margin-top: 10px;
}

.verse-number {
    display: inline-block;
    background: #1b5e20;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1b5e20;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error {
    background: #d32f2f;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.back-btn {
    background: #555;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: #666;
}

.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
}

.hadith-card {
    background: #fafafa;
    padding: 30px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 5px solid #1b5e20;
}

.hadith-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.8em;
    color: #1b5e20;
    text-align: right;
    direction: rtl;
    margin-bottom: 20px;
    line-height: 2.2;
}

.hadith-translation {
    font-size: 1.1em;
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.hadith-reference {
    font-size: 0.95em;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    margin-top: 10px;
}

.city-name {
    font-size: 1.3em;
    color: #1b5e20;
    margin: 15px 0;
    font-weight: 600;
}

.bismillah {
    font-family: 'Amiri', serif;
    font-size: 2.8em;
    color: #1b5e20;
    text-align: center;
    margin: 30px 0;
    direction: rtl;
    font-weight: 700;
    line-height: 1.8;
}

.collection-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.collection-btn {
    padding: 15px;
    background: white;
    border: 2px solid #1b5e20;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
    color: #1b5e20;
}

.collection-btn:hover {
    background: #e8f5e9;
}

.collection-btn.active {
    background: #1b5e20;
    color: white;
}

.mode-selector {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.mode-selector h3 {
    margin-bottom: 12px;
    color: #1b5e20;
    font-size: 1.1em;
}

.mode-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-label {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #1b5e20;
    transition: all 0.3s;
}

.mode-label:hover {
    background: #e8f5e9;
}

.info-text {
    margin-top: 12px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.6;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.hadith-navigation {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.nav-hadith-btn {
    padding: 10px 20px;
    background: #1b5e20;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.nav-hadith-btn:hover {
    background: #2e7d32;
}

.chapter-select-wrapper {
    margin: 20px 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.chapter-select-wrapper label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #1b5e20;
}

.chapter-select-wrapper select {
    width: 100%;
}

.chapter-select-wrapper select {
    width: 100%;
}

.chapter-select-wrapper select {
    width: 100%;
}

.translation-selector {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 2px solid #1b5e20;
}

.translation-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1b5e20;
    font-size: 1.1em;
}

.translation-selector select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.translation-selector select:focus {
    outline: none;
    border-color: #1b5e20;
}

/* ==================== QIBLA ==================== */
.qibla-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.qibla-container {
    max-width: 600px;
    margin: 0 auto;
}

.qibla-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.qibla-location {
    font-size: 1.1em;
    color: #1b5e20;
    font-weight: 600;
    margin-bottom: 10px;
}

.qibla-distance {
    font-size: 1em;
    color: #666;
}

.compass-container {
    position: relative;
    margin: 40px auto;
    text-align: center;
}

.compass {
    width: 350px;
    height: 350px;
    margin: 0 auto 30px;
    position: relative;
    display: block;
}

.compass-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #f5f5f5);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 5px 15px rgba(255, 255, 255, 0.8),
        inset 0 -5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 8px solid #1b5e20;
}

/* Cercle central de la boussole */
.compass-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #1b5e20;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

/* Lignes de marquage sur la boussole */
.compass-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    border-radius: 50%;
    border: 2px dashed rgba(27, 94, 32, 0.2);
}

.compass-rose {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.5s ease-out;
}

.compass-north,
.compass-east,
.compass-south,
.compass-west {
    position: absolute;
    font-size: 2em;
    font-weight: 900;
    font-family: 'Tajawal', sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid currentColor;
}

.compass-north {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #d32f2f;
    background: #ffebee;
}

.compass-east {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    background: #f5f5f5;
}

.compass-south {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    background: #f5f5f5;
}

.compass-west {
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    background: #f5f5f5;
}

.qibla-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.5s ease-out;
    z-index: 10;
    text-align: center;
}

.arrow-head {
    font-size: 6em;
    color: #1b5e20;
    text-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(27, 94, 32, 0.3);
    line-height: 0.8;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 10px rgba(27, 94, 32, 0.5));
}

.arrow-label {
    font-size: 1em;
    font-weight: 900;
    color: white;
    background: #1b5e20;
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(27, 94, 32, 0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid #2e7d32;
}

.qibla-degree {
    font-size: 2.5em;
    font-weight: 900;
    color: #1b5e20;
    margin: 20px 0;
    padding: 20px 30px;
    background: linear-gradient(145deg, #e8f5e9, #f1f8f4);
    border-radius: 12px;
    display: inline-block;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 2px 5px rgba(255, 255, 255, 0.5);
    border: 3px solid #1b5e20;
    min-width: 150px;
}

.qibla-instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
}

.qibla-instructions h3 {
    color: #1b5e20;
    margin-bottom: 15px;
}

.qibla-instructions ul {
    list-style: none;
    padding: 0;
}

.qibla-instructions li {
    padding: 8px 0;
    color: #555;
    line-height: 1.6;
}

#qiblaError {
    margin-top: 20px;
}

/* Animation de pulsation pour la flèche */
@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.qibla-arrow .arrow-head {
    animation: pulse 2s infinite ease-in-out;
}

@media (max-width: 768px) {
    .arabic-title {
        font-size: 2em;
    }

    h1 {
        font-size: 1.5em;
    }

    .location-inputs {
        grid-template-columns: 1fr;
    }

    .prayer-times {
        grid-template-columns: 1fr;
    }

    .navigation {
        flex-wrap: wrap;
    }

    .nav-btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Boussole responsive */
    .compass {
        width: 280px;
        height: 280px;
    }
    
    .compass-north,
    .compass-east,
    .compass-south,
    .compass-west {
        font-size: 1.5em;
        width: 35px;
        height: 35px;
    }
    
    .arrow-head {
        font-size: 5em;
    }
    
    .arrow-label {
        font-size: 0.9em;
        padding: 6px 12px;
    }
    
    .qibla-degree {
        font-size: 2em;
        padding: 15px 25px;
    }
}
