/* =================================================================
   1. بنەما و گۆڕاوەکان (Variables & Root)
   ================================================================= */
:root {
    --primary-color: #007BFF;
    --secondary-color: #ffffff;
    --background-color: #f8f9fa;
    --text-color: #343a40;
    --border-color: #e9ecef;
    --font-family: 'Noto Sans Arabic', sans-serif;
    --font-size: 16px;
}

/* دۆخی تاریک */
[data-theme="dark"] {
    --primary-color: #0069D9;
    --secondary-color: #2c3034;
    --background-color: #212529;
    --text-color: #f8f9fa;
    --border-color: #495057;
}

/* =================================================================
   2. ستایلی گشتی و پارێزگاری (Global & Security Styles)
   ================================================================= */
body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    direction: rtl;
    line-height: 1.8;
    overflow-x: hidden;
}

/* کاتێک مینیو کراوەیە، سکڕۆڵی body قفڵ بکە */
body.menu-is-open {
    overflow: hidden;
}

/* =================================================================
   3. ستایلی Header و App Container
   ================================================================= */
.app-header {
    background: linear-gradient(90deg, #007BFF, #0056b3);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-title { margin: 0; font-size: 1.3em; font-weight: 600; }
.menu-button { background: none; border: none; color: white; font-size: 24px; cursor: pointer; }
#app-container { padding: 15px; }

/* =================================================================
   4. ستایلی لیستی کۆرسەکان (Course List)
   ================================================================= */
.course-item {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
}
.course-item:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08); }
.course-item .icon { width: 28px; height: 28px; }
.course-item .fa-lock, .course-item .fa-folder-open { color: var(--primary-color); font-size: 1.4em; }

/* =================================================================
   5. ستایلی پیشاندانی ناوەڕۆک (Content View)
   ================================================================= */
.content-view { padding: 25px; background-color: var(--secondary-color); border: 1px solid var(--border-color); border-radius: 12px; }
.content-view h1, .content-view h2, .content-view h3 { color: var(--primary-color); border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.content-view img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.content-view p, .content-view li { white-space: pre-wrap; word-wrap: break-word; }
.content-view table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.content-view th, .content-view td { border: 1px solid var(--border-color); padding: 12px; text-align: right; }
.content-view th { background-color: var(--background-color); }
.content-view code { background-color: var(--border-color); padding: 2px 6px; border-radius: 4px; font-family: monospace; direction: ltr; }
.content-view blockquote { border-right: 4px solid var(--primary-color); padding-right: 15px; margin-right: 0; background-color: var(--background-color); }

/* =================================================================
   6. ستایلی مینیۆی لا و پەردە (Nav Menu & Overlay)
   ================================================================= */
.nav-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background-color: var(--secondary-color);
    box-shadow: -3px 0 15px rgba(0,0,0,0.15);
    transition: right 0.3s ease-in-out;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}
.nav-menu.active {
    right: 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding: 20px; }
#close-menu-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-color); }
.settings-container { padding: 15px 20px; overflow-y: auto; flex-grow: 1; }
hr { border: none; border-top: 1px solid var(--border-color); margin: 15px 0; }

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    background-color: var(--background-color);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
.menu-item:hover { background-color: var(--border-color); transform: translateX(-5px); }
.menu-item i { width: 30px; text-align: center; color: var(--primary-color); font-size: 1.2em; margin-left: 15px; }
.menu-item span { font-weight: 500; font-size: 1.05em; }

.setting-item { margin-top: 20px; }
.setting-item label { display: block; margin-bottom: 8px; font-weight: 500; }
.setting-item select { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--secondary-color); color: var(--text-color); }
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

/* =================================================================
   7. ستایلی مۆداڵی چالاککردن (Activation Modal)
   ================================================================= */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; backdrop-filter: blur(5px); background-color: rgba(0, 0, 0, 0.5); }
.modal-content { background-color: var(--secondary-color); margin: 15% auto; padding: 25px; border: 1px solid var(--border-color); width: 85%; max-width: 500px; border-radius: 12px; text-align: center; }
.modal-content input { width: calc(100% - 22px); padding: 12px; margin: 12px 0; direction: ltr; text-align: center; border: 1px solid var(--border-color); border-radius: 8px; }
.how-to-activate-link { background: none; border: 1px solid var(--primary-color); color: var(--primary-color); padding: 5px 12px; border-radius: 5px; cursor: pointer; display: inline-block; margin-bottom: 15px; font-size: 13px; text-decoration: none; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }
.modal-buttons button { padding: 12px 25px; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; font-weight: bold; flex-grow: 1; }
#submit-activation-code { background-color: var(--primary-color); color: white; }
#close-modal { background-color: #6c757d; color: white; }
#activation-status { margin-top: 15px; font-weight: bold; }

/* =================================================================
   8. ستایلی تایبەت (Miscellaneous)
   ================================================================= */
.more-apps-list { list-style: none; padding: 0; }
.app-item { display: flex; align-items: center; background-color: var(--background-color); padding: 10px; border-radius: 8px; margin-bottom: 10px; }
.app-item img { width: 60px; height: 60px; border-radius: 12px; margin-left: 15px; object-fit: cover; }
.app-info { flex-grow: 1; }
.app-info h4 { margin: 0 0 5px 0; }
.app-info p { margin: 0; font-size: 0.9em; opacity: 0.8; }
.app-download-btn { background-color: var(--primary-color); color: white; padding: 8px 15px; border-radius: 5px; text-decoration: none; font-size: 14px; white-space: nowrap; }

/* ڕێگەدان بە هەڵبژاردن تەنها لە شوێنە پێویستەکان */
#device-id-display, #image-link {
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    user-select: all;
}
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}