:root {
    --bg-color: #02050A;
    --card-bg: #0A192F;
    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: #0D2140;
    --accent-color: #64C8FF;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

.basmalah { text-align: center; font-size: 2.2rem; font-weight: 700; padding: 20px 0; opacity: 0.9; font-family: 'Times New Roman', serif; letter-spacing: 3px; }

.header { text-align: center; margin-bottom: 30px; padding: 30px 20px; background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; }
.header h1 { font-size: 2rem; font-weight: 600; margin-bottom: 8px; }
.header h2 { font-size: 1.1rem; font-weight: 400; opacity: 0.8; margin-bottom: 20px; }

.stats { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.stat-badge { background-color: var(--bg-color); border: 1px solid rgba(255, 255, 255, 0.15); padding: 6px 16px; border-radius: 50px; font-size: 0.8rem; opacity: 0.9; }

.verse-card-top, .verse-card-bottom { width: 75%; margin: 25px auto; padding: 18px 25px; background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; text-align: center; font-style: italic; opacity: 0.9; line-height: 1.8; }
.verse-card-bottom { font-size: 0.8rem; margin-top: 40px; line-height: 2; }
.verse-ref { font-style: normal; font-size: 0.7rem; opacity: 0.7; margin-left: 5px; }
.verse-divider { border: 0; border-top: 0.5px solid rgba(255, 255, 255, 0.15); margin: 12px auto; width: 80%; }

.notice-box { text-align: center; margin: 0 auto 30px auto; padding: 15px; background-color: var(--card-bg); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px; font-size: 0.85rem; max-width: 900px; }

/* 🔍 Search Box Styling */
.search-container {
    max-width: 600px;
    margin: 20px auto 30px auto;
    padding: 0 20px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    font-size: 1.2rem;
    opacity: 0.6;
    pointer-events: none;
}

#searchBox {
    width: 100%;
    padding: 12px 45px 12px 45px;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

#searchBox:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(100, 200, 255, 0.1);
}

#searchBox::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 5px 10px;
}

.clear-btn:hover {
    opacity: 1;
}

.search-stats {
    text-align: center;
    margin-top: 10px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.accessibility-tools { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; justify-content: center; }
.accessibility-tools button { padding: 8px 16px; background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; }
.accessibility-tools button:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.3); }
.accessibility-tools button.active { background: rgba(255, 255, 255, 0.1); border-color: var(--text-main); }

.section-title { font-size: 1.3rem; font-weight: 600; margin: 35px 0 15px 0; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); display: inline-block; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 40px; }

.city-card { background-color: var(--card-bg); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 16px 14px; transition: all 0.2s ease; display: flex; flex-direction: column; }
.city-card:hover { border-color: rgba(255, 255, 255, 0.2); background-color: var(--hover-bg); }

.city-name { 
    font-size: 1.1rem; 
    font-weight: 600; 
    margin-bottom: 10px; 
    padding-bottom: 6px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); 
    text-align: center; 
    letter-spacing: 0.3px;
    /* دعم الأحرف الخاصة في الأسماء الأوروبية */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.prayer-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px 6px; margin-bottom: 10px; font-size: 0.8rem; }
.prayer-item { display: flex; justify-content: space-between; padding: 2px 0; }
.prayer-label { opacity: 0.7; font-weight: 300; }
.prayer-value { font-weight: 500; }

.weather-info { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 8px; margin-top: 4px; font-size: 0.75rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.weather-item { display: flex; justify-content: space-between; padding: 1px 0; }
.weather-label { opacity: 0.6; font-weight: 300; }
.weather-value { font-weight: 400; }

.scroll-top { position: fixed; bottom: 30px; right: 30px; background: var(--card-bg); color: var(--text-main); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; width: 50px; height: 50px; font-size: 1.5rem; cursor: pointer; transition: all 0.3s ease; display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0.8; }
.scroll-top:hover { background: var(--hover-bg); opacity: 1; }
.scroll-top.visible { display: flex; }

.footer { text-align: center; margin-top: 50px; padding: 25px 20px; font-size: 0.75rem; opacity: 0.6; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer .privacy-pledge { margin: 15px auto; padding: 15px 20px; background: rgba(255, 255, 255, 0.05); border-radius: 8px; border-left: 3px solid var(--text-main); font-size: 0.7rem; text-align: left; max-width: 800px; line-height: 1.7; }
.gift-box { margin: 20px auto; padding: 12px 20px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; text-align: center; font-size: 0.7rem; opacity: 0.7; max-width: 600px; line-height: 1.8; }

body.high-contrast { background-color: #000; color: #FFF; }
body.high-contrast .header, body.high-contrast .city-card, body.high-contrast .verse-card-top { background-color: #111; border-color: #FFF; color: #FFF; }
body.large-text { font-size: 125%; line-height: 1.8; }
body.extra-large-text { font-size: 150%; line-height: 2; }

/* =========================================
   NEW: City Info & Image Styling (228 Cities)
   ========================================= */

.city-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.city-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 8px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.info-label {
    font-size: 0.7rem;
    opacity: 0.6;
    font-weight: 300;
}

.info-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
}

/* High Contrast Support for New Elements */
body.high-contrast .city-info-grid {
    background-color: #000;
    border-color: #FFF;
}
body.high-contrast .info-value {
    color: #FFF;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cards-grid { grid-template-columns: 1fr; }
    .verse-card-top, .verse-card-bottom { width: 100%; }
    .basmalah { font-size: 1.6rem; }
    .search-container { padding: 0 10px; }
}

@media (max-width: 360px) {
    .city-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .info-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 4px;
    }
    .info-item:last-child {
        border-bottom: none;
    }
}
