/* المتغيرات الأساسية القابلة للتخصيص عبر الثيمات */
:root {
    --bg-dark: #070f16;
    --glass-bg: rgba(19, 32, 46, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --menu-bg: rgba(7, 15, 22, 0.9);
    --primary-green: #00b894; 
    --primary-blue: #0984e3; 
    --text-main: #f5f6fa;
    --text-muted: #a4b0be;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Cairo', 'Poppins', sans-serif;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 184, 148, 0.1), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(9, 132, 227, 0.1), transparent 40%);
    background-attachment: fixed;
    padding-left: 90px;
}

html[dir="ltr"] body {
    padding-left: 0;
    padding-right: 90px;
}

body.sidebar-hidden {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.sidebar-hidden .shortcuts-sidebar {
    display: none !important;
}

.container {
    width: 100%;
    max-width: 850px;
    height: 100%;
    padding: 2vh 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* القائمة الجانبية (الشريط) */
.shortcuts-sidebar {
    position: fixed;
    left: 20px;
    top: 20px;
    bottom: 20px;
    width: 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    z-index: 999;
}

html[dir="ltr"] .shortcuts-sidebar {
    left: auto;
    right: 20px;
}

.shortcuts-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    padding: 10px 0;
}

.shortcuts-wrapper::-webkit-scrollbar { width: 3px; height: 3px; }
.shortcuts-wrapper::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

.shortcut-item {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.shortcut-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    overflow: hidden;
    flex-shrink: 0;
    -webkit-user-drag: none;
}

.shortcut-link:hover {
    transform: scale(1.08);
    background: rgba(128, 128, 128, 0.2);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
    border-color: var(--primary-green);
}

.shortcut-link img { 
    width: 24px; 
    height: 24px; 
    object-fit: contain; 
    border-radius: 4px;
    pointer-events: none;
    -webkit-user-drag: none;
}

.shortcut-link i { color: var(--text-main); font-size: 1.2rem; }

.shortcut-controls {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

.edit-active .shortcut-controls { 
    display: flex; 
}

.edit-active .shortcut-link { 
    border-color: #ff7675 !important; 
    pointer-events: none;
    opacity: 0.5; 
    transform: none;
}

.sh-btn {
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid transparent; 
    color: var(--text-main); 
    cursor: pointer;
    font-size: 0.8rem; 
    width: 24px; 
    height: 24px; 
    display: flex; 
    align-items: center;
    justify-content: center; 
    border-radius: 50%;
    transition: all 0.2s;
}
.sh-btn:hover { background: rgba(128, 128, 128, 0.3); border-color: var(--glass-border); }
.sh-btn.del { color: #ff7675; }
.sh-btn.del:hover { background: rgba(255,118,117,0.2); border-color: #ff7675; }

.sidebar-actions {
    display: flex; flex-direction: column; gap: 12px; margin-top: 15px;
    border-top: 1px solid var(--glass-border); padding-top: 15px; width: 100%; align-items: center;
}

/* أزرار وزوايا */
.corner-btn {
    position: fixed;
    z-index: 99;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.globe-link-btn { top: 20px; right: 20px; }
html[dir="ltr"] .globe-link-btn { right: auto; left: 20px; }
.globe-link-btn:hover { background: rgba(128, 128, 128, 0.2); transform: translateY(-2px) rotate(15deg); box-shadow: 0 5px 15px rgba(0, 184, 148, 0.4); color: var(--primary-green); }

.bg-edit-btn { bottom: 20px; right: 20px; }
html[dir="ltr"] .bg-edit-btn { right: auto; left: 20px; }
.bg-edit-btn:hover { background: rgba(128, 128, 128, 0.2); transform: scale(1.1); box-shadow: 0 5px 15px rgba(253, 203, 110, 0.4); color: #fdcb6e; }

/* إعدادات المظهر */
.bg-settings-menu {
    display: none;
    position: fixed;
    bottom: 75px;
    right: 20px;
    width: 280px;
    padding: 18px;
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
}
html[dir="ltr"] .bg-settings-menu { right: auto; left: 20px; }
.bg-settings-menu::-webkit-scrollbar { width: 4px; }
.bg-settings-menu::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

.bg-settings-menu h4 { margin-top: 10px; margin-bottom: 12px; font-size: 1rem; color: var(--primary-blue); text-align: center; border-top: 1px solid var(--glass-border); padding-top: 10px; }
.bg-settings-menu h4:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.glass-input {
    width: 100%; padding: 8px 10px; margin-top: 5px; margin-bottom: 12px;
    background: rgba(128, 128, 128, 0.1); border: 1px solid var(--glass-border);
    color: var(--text-main); border-radius: 8px; outline: none; font-family: 'Cairo', sans-serif;
}
.glass-input option { background: #13202e; color: #f5f6fa; }

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 8px;
}
.color-picker-input {
    flex-grow: 1;
    height: 38px;
    border: 1px solid var(--glass-border);
    background: rgba(128, 128, 128, 0.1);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}

.toggle-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.toggle-item span { color: var(--text-main); font-weight: 600; }
.toggle-item input[type="checkbox"] {
    accent-color: var(--primary-green);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

header { display: flex; justify-content: space-between; align-items: center; padding: 1.5vh 25px; width: 100%; }

.logo { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 1.5rem; 
    font-weight: 800; 
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue)); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}
.logo i {
    -webkit-text-fill-color: initial;
    color: var(--primary-green);
}
.logo img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 6px;
}

.controls { display: flex; gap: 15px; }

.icon-btn { background: rgba(128, 128, 128, 0.1); border: 1px solid var(--glass-border); color: var(--text-main); width: 45px; height: 45px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.icon-btn:hover { background: rgba(128, 128, 128, 0.2); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(9, 132, 227, 0.3); color: var(--primary-blue); }

.main-search-section { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 3vh;
    width: 100%; 
    flex-grow: 1;
}

.date-time-container { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.clock-display { font-size: clamp(2rem, 5vh, 3rem); font-weight: 800; background: linear-gradient(135deg, var(--text-main), var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-family: 'Poppins', 'Cairo', sans-serif; letter-spacing: 1px; }
.date-display { font-size: clamp(0.9rem, 2vh, 1.1rem); color: var(--text-muted); font-weight: 600; }

.search-form { width: 100%; max-width: 600px; display: flex; align-items: center; padding: 6px 20px; border-radius: 50px; }
.search-form:focus-within { border-color: rgba(0, 184, 148, 0.5); box-shadow: 0 0 20px rgba(0, 184, 148, 0.2); }
.search-icon { color: var(--text-muted); font-size: 1.2rem; margin-left: 15px; }
html[dir="ltr"] .search-icon { margin-left: 0; margin-right: 15px; }
.search-input { width: 100%; background: none; border: none; outline: none; color: var(--text-main); font-size: 1.1rem; font-family: 'Cairo', sans-serif; padding: 10px 0; }
.search-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.search-submit-btn { background: none; border: none; color: var(--primary-green); cursor: pointer; font-size: 1.2rem; padding: 5px; }
.search-submit-btn:hover { color: var(--primary-blue); transform: scale(1.1); }

.dhikr-container { padding: 2vh 20px; text-align: center; position: relative; overflow: hidden; width: 100%; max-width: 600px; margin: 0 auto; min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
.dhikr-container::before { content: '\f10d'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; top: -10px; right: 20px; font-size: 3rem; color: rgba(128, 128, 128, 0.08); z-index: 0; pointer-events: none; }
html[dir="ltr"] .dhikr-container::before { right: auto; left: 20px; content: '\f10e'; }

.panel-content { width: 100%; transition: opacity 0.3s ease; position: relative; z-index: 1; }
.dhikr-title { font-size: clamp(0.8rem, 1.5vh, 0.95rem); color: var(--primary-green); margin-bottom: 1.5vh; display: flex; align-items: center; justify-content: center; gap: 8px; }

.dhikr-text { font-size: clamp(1rem, 2vh, 1.15rem); line-height: 1.6; margin-bottom: 1vh; }
.refresh-dhikr { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.refresh-dhikr:hover { color: var(--primary-blue); transform: rotate(180deg); }

.news-slider-wrapper { position: relative; width: 100%; height: 50px; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: pan-y; cursor: grab; }
.news-slider-wrapper:active { cursor: grabbing; }
.news-item { position: absolute; width: 100%; opacity: 0; transform: translateY(20px); transition: all 0.4s ease; text-decoration: none; color: var(--text-main); font-weight: 600; font-size: clamp(0.95rem, 1.8vh, 1.1rem); line-height: 1.5; pointer-events: none; }
.news-item.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.news-item:hover { color: var(--primary-green); }

.currency-inputs { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.currency-result { font-size: clamp(1.2rem, 2.5vh, 1.5rem); font-weight: 800; color: var(--primary-blue); }

.weather-info { display: flex; align-items: center; justify-content: center; gap: 15px; }
.weather-temp { font-size: clamp(1.5rem, 3vh, 2rem); font-weight: 800; color: var(--primary-blue); }

.bottom-section { width: 100%; padding-bottom: 1vh; }
#location-prompt { text-align: center; padding: 3vh 20px; margin-bottom: 1vh; }
.icon-large { font-size: 2rem; color: var(--primary-blue); margin-bottom: 1.5vh; }

.btn-action { background: linear-gradient(135deg, var(--primary-green), var(--primary-blue)); border: none; color: white !important; padding: 1vh 30px; font-size: 1rem; font-weight: 600; border-radius: 30px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-action:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 20px rgba(0, 184, 148, 0.3); }

#weekly-weather-container { display: none; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 1vh; width: 100%; max-width: 800px; margin: 0 auto; }
.weather-card { padding: 1.5vh 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5vh; position: relative; overflow: hidden; }
.weather-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary-green), var(--primary-blue)); transform: scaleX(0); transition: transform 0.3s ease; }
.weather-card:hover::after { transform: scaleX(1); }
.weather-card:hover { transform: translateY(-5px); border-color: rgba(9, 132, 227, 0.3); }
.weather-icon { font-size: clamp(1.2rem, 2.5vh, 1.6rem); color: var(--primary-green); margin-bottom: 2px; }
.weather-day { font-size: clamp(0.85rem, 1.5vh, 1rem); font-weight: 600; color: var(--text-muted); }
.weather-temp-range { font-size: clamp(1.1rem, 2vh, 1.35rem); font-weight: 800; color: var(--text-main); white-space: nowrap; direction: ltr; }
.status-msg { text-align: center; padding: 2vh; grid-column: 1 / -1; font-size: 1.1rem; }

/* تعديلات شاشات الموبايل */
@media (max-width: 768px) {
    body { padding-left: 0 !important; padding-right: 0 !important; padding-bottom: 95px !important; }
    
    .shortcuts-sidebar { 
        left: 15px; right: 15px; bottom: 15px; top: auto; width: auto; 
        height: 70px; flex-direction: row; padding: 10px; 
    }
    html[dir="ltr"] .shortcuts-sidebar { left: 15px; right: 15px; }
    
    .shortcuts-wrapper { 
        flex-direction: row; 
        justify-content: flex-start; 
        overflow-x: auto; 
        overflow-y: hidden; 
        padding: 0 10px; 
        gap: 15px;
    }
    
    .shortcut-item { flex-direction: row; width: auto; gap: 8px; }
    .shortcut-controls { flex-direction: row; padding: 4px 10px; border-radius: 20px; gap: 6px; }
    
    .sidebar-actions { 
        flex-direction: row; border-top: none; padding-top: 0; 
        width: auto; margin-top: 0; margin-right: auto; 
        padding-right: 15px; border-right: 1px solid var(--glass-border); 
    }
    html[dir="ltr"] .sidebar-actions { 
        margin-right: 0; margin-left: auto; padding-right: 0; 
        padding-left: 15px; border-right: none; border-left: 1px solid var(--glass-border); 
    }

    #weekly-weather-container { grid-template-columns: repeat(3, 1fr); }
    .bg-edit-btn { bottom: 105px; }
    .bg-settings-menu { bottom: 160px; }
}
@media (max-width: 480px) {
    #weekly-weather-container { grid-template-columns: repeat(2, 1fr); gap: 1.5vh; }
}
