  :root {
    /* الوان موقع الزين - الوضع النهاري (الافتراضي) */
    --bg: #f7f7f7;
    --text: #222;
    --accent: #0066ff; 
    --card-bg-solid: rgba(255, 255, 255, 0.95);
    --muted: #666;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --border-color: #eee;
    
    /* الوان خاصة بالتصميم الزجاجي */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --input-bg: rgba(255, 255, 255, 0.15);
    --item-bg: rgba(255, 255, 255, 0.1);

    /* الوان التحديات */
    --bronze: #cd7f32;
    --silver: #c0c0c0;
    --gold: #ffd700;
    --level-bg: rgba(0, 102, 255, 0.1);
  }

  /* (مُعدل) الوان موقع الزين - الوضع الليلي */
  body[data-theme="dark"] {
    --bg: #0d1117; 
    --text: #e2e8f0;
    --accent: #00aaff; 
    --card-bg-solid: rgba(20, 25, 30, 0.88);
    --muted: #a0aec0;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    --border-color: #333;

    /* الوان خاصة بالتصميم الزجاجي ليلاً */
    --glass-bg: rgba(20, 25, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.2);
    --input-bg: rgba(0, 0, 0, 0.2);
    --item-bg: rgba(0, 0, 0, 0.15);
    --level-bg: rgba(0, 170, 255, 0.15);
  }
  
  /* (جديد) الثيم البحري: "محيط" */
  body[data-theme="ocean"] {
    --bg: #F0F8FF; /* أزرق سماوي فاتح */
    --text: #00334E; /* أزرق غامق (كحلي) */
    --accent: #00A896; /* تركواز */
    --card-bg-solid: rgba(255, 255, 255, 0.95); /* صلب */
    --muted: #005E7C;
    --shadow: 0 8px 20px rgba(0, 168, 150, 0.15);
    --border-color: #D1E9FF;

    /* الوان خاصة بالتصميم الزجاجي */
    --glass-bg: rgba(240, 248, 255, 0.4); /* استخدام لون الخلفية مع شفافية */
    --glass-border: rgba(0, 51, 78, 0.2); /* استخدام لون النص مع شفافية */
    --input-bg: rgba(255, 255, 255, 0.3);
    --item-bg: rgba(255, 255, 255, 0.2);
    --level-bg: rgba(0, 168, 150, 0.1);
  }


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

  html {
    scroll-behavior: smooth;
  }
  
  body {
    font-family: 'Cairo', 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    min-height: 100vh;
    padding: 20px 20px 100px 20px; /* تقليل الحشو السفلي */
    transition: background 0.4s, color 0.4s;
  }

  /* Animated background blobs */
  .background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
  }
  .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
  }
  .blob1 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: -100px;
    left: -100px;
    animation: moveBlob1 15s infinite alternate ease-in-out;
  }
  .blob2 {
    width: 300px;
    height: 300px;
    background: #26d0ce;
    bottom: -50px;
    right: -50px;
    animation: moveBlob2 12s infinite alternate ease-in-out;
  }
  @keyframes moveBlob1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(200px, 100px) scale(1.2); }
  }
  @keyframes moveBlob2 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-150px, -100px) scale(0.8); }
  }
  
  .top-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    z-index: 100;
  }
  
  .control-btn {
    font-size: 20px; 
    cursor: pointer; 
    color: var(--text); 
    transition: color .4s, background .4s, transform 0.3s; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    width: 44px; 
    height: 44px; 
    border-radius: 12px; 
    background: var(--card-bg-solid); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
  }
  .control-btn:hover {
      transform: translateY(-2px);
  }
  .control-btn[aria-pressed="true"] { 
      color: var(--accent); 
  }
  
  /* حاوية التطبيق الرئيسية */
  .app-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px; 
    z-index: 2;
    margin-bottom: 100px; /* تقليل الهامش السفلي */
  }
  
  /* ستايل صفحات التطبيق (لإخفاء وإظهار الأقسام) */
  .app-page {
    display: none; 
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.5s ease;
  }
  .app-page.active {
    display: flex; 
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* ستايل زجاجي مشترك (لإعادة الاستخدام) */
  .glass-box {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 25px;
    width: 100%;
    border: 1px solid var(--glass-border);
    transition: background 0.4s, border-color 0.4s;
  }
  
  /* --- 1. ستايلات قسم المهام --- */
  
  .motivation-widget {
    padding: 20px 25px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    font-style: italic;
    line-height: 1.6;
  }
  .motivation-widget::before {
    content: " رسالة الزين لك اليوم :";
    display: block;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 8px;
  }
  
  .datetime-widget {
    padding: 20px 25px;
    text-align: center;
  }
  #time-display {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    direction: ltr; 
  }
  #date-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    opacity: 0.9;
    margin-top: 5px;
  }
  /* (مُزال) تم إزالة التاريخ الهجري */
  
  .todo-box {
    padding: 30px;
  }
  .date-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  .date-nav-btn {
    flex: 1;
    background: var(--card-bg-solid);
    color: var(--muted);
    border: 1px solid var(--border-color);
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  #nav-picker {
    flex: 0 0 auto;
    width: 44px;
    padding: 0;
    font-size: 16px;
  }
  .date-nav-btn:hover { background: var(--border-color); }
  .date-nav-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 10px var(--accent);
  }
  body[data-theme="ocean"] .date-nav-btn.active {
      box-shadow: 0 4px 10px rgba(0, 168, 150, 0.4);
  }
  body[data-theme="dark"] .date-nav-btn.active {
      box-shadow: 0 4px 10px rgba(0, 170, 255, 0.4);
  }


  #task-list-title {
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 900;
    color: var(--accent);
    text-align: center;
  }
  #task-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  #task-input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    outline: none;
    font-family: 'Cairo', 'Inter', sans-serif;
    background: var(--input-bg);
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
  }
  #task-input:focus {
    background: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent);
  }
  #task-input:disabled {
    background: rgba(0, 0, 0, 0.05);
    cursor: not-allowed;
  }
  #task-form button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0 25px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--accent);
  }
  #task-form button:hover {
    background: var(--accent);
    opacity: 0.8;
    transform: translateY(-2px);
  }
  #task-form button:disabled {
    background: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
  }
  #task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 100px;
    max-height: 30vh;
    overflow-y: auto;
  }
  .task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    word-break: break-word;
  }
  .task-item.completed {
    background: rgba(0,0,0,0.05);
    border-color: transparent;
  }
  .task-content {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
    overflow: hidden; 
    padding-left: 5px;
  }
  .task-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
  }
  .task-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
  }
  .task-checkbox:checked::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .task-content span {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .task-item.completed .task-content span {
    text-decoration: line-through;
    opacity: 0.6;
    font-style: italic;
  }
  .delete-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 20px;
    transition: color 0.3s, background 0.3s;
    flex-shrink: 0;
  }
  .delete-btn:hover {
    color: #d9534f;
    background: rgba(217, 83, 79, 0.1);
  }
  .clear-btn {
    width: 100%;
    background: var(--card-bg-solid);
    color: var(--muted);
    border: 1px solid var(--border-color);
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 20px;
  }
  .clear-btn:hover {
    background: #d9534f;
    color: #fff;
    border-color: #d9534f;
  }

  /* --- (جديد) ستايلات قسم الملاحظات الاحترافي --- */
  .notes-box {
    padding: 25px 30px;
  }
  .notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
  }
  .notes-header h3 {
    text-align: right;
    font-weight: 900;
    color: var(--accent);
    font-size: 1.8rem;
    margin: 0;
  }
  .add-note-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .add-note-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
  }
  
  #notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 40vh;
    overflow-y: auto;
  }
  .note-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
  }
  .note-list-item:hover {
    background: var(--item-bg);
  }
  .note-list-item:last-child {
    border-bottom: none;
  }
  .note-item-details {
    overflow: hidden; /* لمنع النص الطويل من الخروج */
  }
  .note-item-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .note-item-date {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--muted);
  }
  .note-item-arrow {
    font-size: 0.9rem;
    color: var(--muted);
    flex-shrink: 0;
  }
  .no-notes {
    text-align: center;
    color: var(--muted);
    padding: 20px;
    font-size: 0.9rem;
    font-weight: 700;
  }
  
  /* ستايلات مودال الملاحظات */
  #notes-modal-content #note-content-input {
    width: 100%;
    min-height: 200px;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    outline: none;
    font-family: 'Cairo', 'Inter', sans-serif;
    background: var(--input-bg);
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
    resize: vertical;
  }
  #notes-modal-content #note-content-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent);
  }
  .note-timestamp {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
    margin-top: 15px;
    height: 1.2em;
    direction: ltr;
  }
  #notes-modal-content h2 {
    text-align: center;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 1.8rem;
  }


  /* --- ستايلات مؤقت التركيز --- */
  .timer-box {
    /* .glass-box */
  }
  .timer-box h3, .tasbeeh-box h3 {
    text-align: center;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.8rem;
  }
  .timer-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  .timer-tab-btn {
    flex: 1;
    background: var(--card-bg-solid);
    color: var(--muted);
    border: 1px solid var(--border-color);
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  .timer-tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  .timer-display {
    font-size: 3.5rem;
    font-family: 'Inter', sans-serif;
    direction: ltr;
    text-align: center;
    color: var(--text);
    font-weight: 900;
    margin-bottom: 20px;
  }
  .timer-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  .timer-inputs input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    outline: none;
    font-family: 'Cairo', 'Inter', sans-serif;
    background: var(--input-bg);
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
    text-align: center;
    -moz-appearance: textfield; /* Firefox */
  }
  .timer-inputs input::-webkit-outer-spin-button,
  .timer-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .timer-inputs input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent);
  }
  .timer-controls {
    display: flex;
    gap: 10px;
  }
  .timer-control-btn {
    flex: 1;
    background: var(--card-bg-solid);
    color: var(--text);
    border: 1px solid var(--border-color);
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
  }
  .timer-control-btn.accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  
  /* ستايل المودال (مشترك للتقويم والإعدادات) */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeInModal 0.3s ease;
  }
  @keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .glass-modal-style {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    padding: 25px;
    width: 100%;
    max-width: 380px;
    color: var(--text);
    transition: background 0.4s, border-color 0.4s, color 0.4s;
    position: relative;
    max-height: 90vh; /* 90% من ارتفاع الشاشة */
    overflow-y: auto; /* إضافة سكرول داخلي عند الحاجة */
    animation: zoomInModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  @keyframes zoomInModal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
  }

  .modal-close-btn {
    position: absolute;
    top: 15px;
    left: 15px; 
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    color: var(--muted);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    line-height: 30px;
    text-align: center;
    transition: all 0.3s;
  }
  .modal-close-btn:hover {
    background: var(--border-color);
    color: var(--text);
  }
  .modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
  }

  /* ستايلات مودال التقويم */
  .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  .calendar-header button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.3s;
  }
  .calendar-header button:hover { background: var(--item-bg); }
  #calendar-month-year {
    font-size: 1.2rem;
    font-weight: 700;
  }
  .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
  }
  .calendar-days div {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
  }
  .calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
  }
  .date-cell {
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    color: var(--text);
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  .date-cell.empty {
    background: none;
    border: 1px solid transparent;
    cursor: default;
    opacity: 0.3;
  }
  .date-cell:not(.empty):hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  .date-cell.today {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
  }
  .date-cell.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }

  /* --- 2. ستايلات قسم القرآن --- */
  
  #quran-bookmark-widget {
    padding: 20px 25px;
    text-align: right;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.6;
    cursor: pointer;
  }
  #quran-bookmark-widget::before {
    content: "علامة الختمة:";
    display: block;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 8px;
  }
  #quran-bookmark-widget small {
    display: block;
    opacity: 0.7;
    font-size: 0.85rem;
  }
  
  .custom-select-wrapper {
    position: relative;
    margin-bottom: 20px;
  }
  .custom-select {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  .custom-select:focus, .custom-select.open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent);
    outline: none;
  }
  .custom-select i {
    color: var(--muted);
    transition: transform 0.3s ease;
  }
  .custom-select.open i {
    transform: rotate(180deg);
  }
  .custom-select-options {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    padding: 5px;
  }
  .custom-select-options.open {
    display: block;
  }
  .custom-option {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 700;
    border-radius: 8px;
  }
  .custom-option:hover {
    background: var(--item-bg);
  }
  .custom-option.selected {
    background: var(--accent);
    color: #fff;
  }

  
  #quran-content {
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
    max-height: 60vh;
    overflow-y: auto;
    font-family: 'Amiri Quran', 'Cairo', serif;
    font-size: 1.5rem; 
    line-height: 2.5; 
    color: var(--text);
  }
  
  #quran-content.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--muted);
  }
  
  .bismillah {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--accent);
  }
  
  .verse { display: inline; }
  
  .verse-number {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--accent);
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    margin-right: 8px;
    margin-left: 8px;
    transition: all 0.3s ease;
    cursor: pointer; 
    user-select: none; 
  }

  #bookmarked-verse {
    background: var(--accent);
    color: #fff;
  }
  
  /* (جديد) ستايل مشغل الصوت */
  #quran-audio-player {
    width: 100%;
    margin-top: 20px;
  }

  /* --- 3. ستايلات قسم المسبحة (الوضع الحر) --- */
  
  .tasbeeh-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  
  #dhikr-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    padding: 15px 25px;
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    text-align: center;
  }
  
  .tasbeeh-counter-display {
    display: flex;
    align-items: center; 
    justify-content: center;
    gap: 10px;
    line-height: 1;
    margin: 10px 0;
  }

  #tasbeeh-count-current {
    font-size: 4.5rem; 
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    color: var(--accent);
    text-align: center;
    transition: color 0.3s ease;
  }

  /* الهدف مخفي في هذا الوضع */
  #tasbeeh-count-target {
    display: none;
  }
  
  #tasbeeh-tap-btn {
    width: 100%; 
    height: auto; 
    padding: 40px 20px; 
    border-radius: 20px; 
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.15s ease-out;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    gap: 10px; 
    font-size: 2.5rem; 
    color: var(--accent);
  }
  #tasbeeh-tap-btn span { 
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    color: var(--muted);
  }
  
  #tasbeeh-tap-btn:active {
    transform: scale(0.98); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: var(--item-bg);
  }
  
  .tasbeeh-controls {
    display: flex;
    gap: 10px;
    width: 100%;
  }
  
  .tasbeeh-btn {
    flex: 1;
    background: var(--card-bg-solid);
    color: var(--text);
    border: 1px solid var(--border-color);
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
  }
  .tasbeeh-btn:hover {
    background: var(--item-bg);
  }
  .tasbeeh-btn.accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  
  #tasbeeh-total-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--input-bg);
    padding: 10px 15px;
    border-radius: 10px;
    margin-top: 10px;
  }

  /* --- (جديد) ستايلات قسم الأذكار --- */

  .adhkar-box {
    padding: 0; /* إزالة الحشو الداخلي للـ glass-box */
  }

  .adhkar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    transition: background 0.3s;
  }
  .adhkar-header:hover {
    background: var(--item-bg);
  }

  .adhkar-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .adhkar-header .toggle-icon {
    font-size: 1.2rem;
    color: var(--muted);
    transition: transform 0.3s ease;
  }

  /* تدوير السهم عند الفتح */
  .adhkar-header.active .toggle-icon {
    transform: rotate(180deg);
  }

  .adhkar-content {
    display: none; /* مخفي افتراضياً */
    padding: 0 25px 25px 25px;
    max-height: 40vh;
    overflow-y: auto;
    border-top: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
  }

  .adhkar-content.active {
    display: block; /* يظهر عند الضغط */
  }
  
  .adhkar-item {
    padding: 15px 0;
    border-bottom: 1px dashed var(--border-color);
  }
  .adhkar-item:last-child {
    border-bottom: none;
  }

  .adhkar-item p.dhikr-text {
    font-family: 'Amiri Quran', 'Cairo', serif;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 2;
    color: var(--text);
  }

  .adhkar-item small.dhikr-count {
    display: block;
    margin-top: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent);
  }


  /* --- 4. ستايلات قسم مواقيت الصلاة --- */
  
  #next-prayer-widget {
    text-align: center;
    padding: 15px;
    background: var(--input-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
  }
  #next-prayer-widget.loading {
    color: var(--muted);
    font-weight: 700;
  }
  #next-prayer-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 5px;
  }
  #next-prayer-countdown {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    direction: ltr;
  }
  
  #prayer-times-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .prayer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
  }
  .prayer-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
  }
  .prayer-item-time {
    font-size: 1.1rem;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    color: var(--accent);
    direction: ltr;
  }
  
  .prayer-item.highlight {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 10px var(--accent);
  }
  .prayer-item.highlight .prayer-item-name,
  .prayer-item.highlight .prayer-item-time {
    color: #fff;
  }

  /* --- 5. ستايلات مودال الإعدادات --- */
  
  .settings-modal-content h2 {
    text-align: center;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 1.8rem;
  }
  .settings-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
  }
  .settings-section p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 20px;
  }
  .settings-btn {
    width: 100%;
    background: var(--card-bg-solid);
    color: var(--text);
    border: 1px solid var(--border-color);
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
  }
  .settings-btn.accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 10px var(--accent);
  }
  .settings-btn:hover {
    transform: translateY(-2px);
  }
  .settings-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--muted);
    margin: 20px 0;
  }
  .divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
  }
  .divider:not(:empty)::before { margin-left: .25em; } /* RTL */
  .divider:not(:empty)::after { margin-right: .25em; } /* RTL */

  .input-group {
    margin-bottom: 15px;
  }
  .input-group label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 5px;
  }
  .input-group input,
  .input-group textarea { /* (مُعدل) ليشمل الـ textarea */
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    outline: none;
    font-family: 'Cairo', 'Inter', sans-serif;
    background: var(--input-bg);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
  }
  .input-group input:focus,
  .input-group textarea:focus { /* (مُعدل) ليشمل الـ textarea */
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent);
  }
  .status-message {
    text-align: center;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.9rem;
  }
  .status-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
  }
  body[data-theme="dark"] .status-message.success,
  body[data-theme="ocean"] .status-message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #81C784;
  }
  .status-message.error {
    background: rgba(255, 99, 71, 0.1);
    color: #d9534f;
  }
  body[data-theme="dark"] .status-message.error,
  body[data-theme="ocean"] .status-message.error {
    background: rgba(255, 99, 71, 0.2);
    color: #FF8A80;
  }
  
  /* --- 6. ستايلات شريط التنقل السفلي --- */
  
  .bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    
    display: flex;
    justify-content: space-around;
    padding: 10px;
    z-index: 100;
  }
  
  .nav-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border-radius: 12px;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0; 
  }
  
  .nav-btn i {
    font-size: 18px;
  }
  .nav-btn span {
    font-size: 0.8rem;
  }
  
  .nav-btn:hover {
    background: var(--item-bg);
  }
  
  .nav-btn.active {
    color: var(--accent);
    background: var(--input-bg);
  }
  
  /* --- 7. ستايلات تذييل حقوق النشر --- */
  .footer {
    position: relative; 
    z-index: 2;
    margin-top: 30px;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
    direction: ltr; 
    font-family: 'Inter', sans-serif; 
  }
  .footer a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
  }
  .footer a:hover {
    color: var(--accent);
  }

  /* --- 8. ستايلات التحريك عند الظهور --- */
  .reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }
  .reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* --- 9. ستايلات التحديات (إضافة جديدة) --- */
  .user-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  .user-info h3 {
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--text);
  }
  .user-level-badge {
    background: var(--level-bg);
    color: var(--accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: 0.3s;
  }
  .user-level-badge:hover {
    transform: scale(1.05);
    background: var(--item-bg);
  }
  .level-icon { color: var(--gold); }
  
  .points-progress-container {
    margin-bottom: 20px;
  }
  .points-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--item-bg);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
  }
  .points-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #42e695);
    width: 0%;
    transition: width 1s ease;
    border-radius: 5px;
  }
  .points-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    margin-top: 5px;
  }

  .challenge-card {
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    transition: transform 0.2s;
  }
  .challenge-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
  }
  .challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  .challenge-title {
    font-weight: 700;
    font-size: 1.1rem;
  }
  .challenge-points-badge {
    background: rgba(255, 215, 0, 0.2);
    color: #b8860b;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
  }
  body[data-theme="dark"] .challenge-points-badge { color: #ffd700; }
  
  .challenge-progress {
    display: flex;
    gap: 5px;
    margin: 10px 0;
  }
  .day-dot {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.3s;
  }
  .day-dot.active { background: var(--accent); }
  
  .challenge-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
  }
  .challenge-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
  }
  .btn-check-in {
    background: var(--accent);
    color: #fff;
  }
  .btn-check-in:disabled {
    background: var(--muted);
    cursor: default;
    opacity: 0.6;
  }
  .btn-give-up {
    background: rgba(217, 83, 79, 0.1);
    color: #d9534f;
    border: 1px solid rgba(217, 83, 79, 0.2);
  }
  .btn-give-up:hover { background: rgba(217, 83, 79, 0.2); }

  /* مودال الاسم الشفاف */
  #name-modal {
    z-index: 2000; /* أعلى من كل شيء */
  }
  .name-input-style {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 15px;
    border: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    outline: none;
    margin: 20px 0;
    font-family: 'Cairo', sans-serif;
  }
  .name-input-style:focus {
    border-color: var(--accent);
    background: var(--input-bg);
  }

  /* ستايل قائمة المستويات */
  .level-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--item-bg);
    border: 1px solid transparent;
  }
  .level-item.active-level {
    border-color: var(--accent);
    background: var(--level-bg);
  }
  .level-name { font-weight: bold; }
  .level-points { font-size: 0.9rem; color: var(--muted); }

/* ===== إضافات التقسيم لصفحات منفصلة ===== */
a.nav-btn { text-decoration: none; -webkit-tap-highlight-color: transparent; }
.bottom-nav { view-transition-name: bottom-nav; }
@view-transition { navigation: auto; }
.app-toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 1000; padding: 12px 20px; border-radius: 14px; max-width: 90%;
  font-weight: 700; font-size: .95rem; text-align: center;
  background: var(--card-bg-solid); color: var(--text);
  border: 1px solid var(--border-color); box-shadow: var(--shadow);
}
.app-toast.success { border-color: #4caf50; }
.app-toast.error { border-color: #d9534f; }
