* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    direction: rtl;
    font-family: Arial, sans-serif;
    background: #f2f4f7;
    color: #222;
}

.app {
    width: 100%;
    max-width: 700px;
    margin: auto;
    padding: 8px;
}


/* الشريط العلوي */

.top-bar {
    display: flex;
    flex-direction: row;
    gap: 5px;
    width: 100%;
    padding: 7px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 10px #ccc;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
}

.top-bar button {
    flex: 1 0 auto;
    min-width: 90px;
    margin: 0;
    white-space: nowrap;
    font-size: 13px;
}


/* الصفحات */

.hidden {
    display: none !important;
}

.page {
    margin-top: 15px;
}


/* البطاقات */

.card {
    background: white;
    padding: 18px;
    margin-bottom: 15px;
    border-radius: 14px;
    box-shadow: 0 2px 8px #ddd;
}


/* الإحصائيات */

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-box {
    background: white;
    padding: 18px 5px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 2px 8px #ddd;
}

.stat-box strong {
    display: block;
    font-size: 26px;
    margin-bottom: 5px;
}


/* الأزرار */

button {
    border: none;
    border-radius: 9px;
    padding: 12px;
    margin-top: 8px;
    background: #4f46e5;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.add-button {
    width: 100%;
    background: #16a085;
}

.back-button {
    width: 100%;
    background: #555;
}

.pause-button {
    width: 100%;
    background: #e67e22;
}

.save-button {
    width: 100%;
    background: #16a085;
}


/* تبويبات المذاكرة */

.study-tabs {
    display: flex;
    flex-direction: row;
    gap: 6px;
    margin-bottom: 15px;
}

.study-tabs button {
    flex: 1;
    margin: 0;
    background: #ddd;
    color: #222;
}

.study-tabs button.active {
    background: #4f46e5;
    color: white;
}


/* الإدخال */

input,
textarea,
select {
    width: 100%;
    padding: 13px;
    margin-top: 8px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 9px;
    background: white;
    font-size: 16px;
    direction: rtl;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

label {
    display: block;
    font-weight: bold;
    margin-top: 12px;
}


/* المؤقت */

.timer {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    padding: 20px;
    margin: 10px 0;
    background: #eef2ff;
    border-radius: 12px;
}


/* الملفات */

.file-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 12px;
}

.file-section h2 {
    margin-top: 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    margin-top: 8px;
    background: white;
    border-radius: 9px;
    border: 1px solid #ddd;
}

.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file {
    background: #e74c3c;
    padding: 7px 10px;
    margin: 0;
}