/* ===================================
   سمو التعليمية - التنسيقات العامة
   General Styles - Sumou Educational
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');

:root {
    /* ألوان سمو التعليمية */
    --primary-color: #06b6d4;
    /* تركواز */
    --secondary-color: #9333ea;
    /* بنفسجي */
    --accent-blue: #0ea5e9;
    /* أزرق فاتح */
    --dark-blue: #1e40af;
    /* أزرق داكن */

    /* ألوان الحالات */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;

    /* ألوان محايدة */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    /* الظلال */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* الحدود */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   التنسيق العام
   =================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ===================================
   الأزرار
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7e22ce;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

/* ===================================
   النماذج
   =================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--error-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ===================================
   الرسائل
   =================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d1fae5;
    border-right: 4px solid var(--success-color);
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border-right: 4px solid var(--error-color);
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-right: 4px solid var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-right: 4px solid var(--info-color);
    color: #1e40af;
}

/* ===================================
   الجداول
   =================================== */

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

thead th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    font-size: 0.95rem;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody td {
    padding: 1rem;
    text-align: right;
}

/* ===================================
   الشارات
   =================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary-color);
}

.badge-secondary {
    background: rgba(147, 51, 234, 0.1);
    color: var(--secondary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* ===================================
   الأيقونات
   =================================== */

.icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
}

/* ===================================
   Utility Classes
   =================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none;
}

/* ===================================
   تأثيرات الحركة
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideUp 0.5s ease;
}

/* ===================================
   Responsive
   =================================== */

/* Tablet and below */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    /* تحسين الجداول للتابلت */
    table {
        font-size: 0.875rem;
    }

    thead th,
    tbody td {
        padding: 0.75rem 0.5rem;
    }
}

/* Mobile Large (معظم الهواتف الحديثة) */
@media (max-width: 640px) {
    .container {
        padding: 0 0.75rem;
    }

    .card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    /* تحسين الأزرار للمس */
    .btn {
        min-height: 44px;
        /* Apple's recommended touch target */
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
        gap: 0.375rem;
    }

    .btn svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    /* تحسين النماذج */
    .form-control {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 16px;
        /* منع zoom تلقائي في iOS */
    }

    select.form-control {
        font-size: 16px;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    /* تحسين الجداول - scroll أفقي واضح */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* smooth scrolling on iOS */
        border-radius: var(--radius-md);
        position: relative;
    }

    /* إضافة shadow لإظهار إمكانية السحب */
    .table-responsive {
        position: relative;
        background: radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) 100% 0;
        background-color: white;
        background-repeat: no-repeat;
        background-size: 10px 100%;
        background-attachment: local, scroll, scroll;
    }

    /* تسمية توضيحية للسحب */
    .table-responsive::before {
        content: '← اسحب للعرض →';
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: var(--text-secondary);
        padding: 0.5rem;
        background: #f8fafc;
        border-bottom: 1px solid var(--border-color);
    }

    table {
        font-size: 0.8125rem;
        min-width: 600px;
        /* ضمان عرض مناسب للمحتوى */
    }

    thead th {
        padding: 0.875rem 0.5rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    tbody td {
        padding: 0.875rem 0.5rem;
    }

    /* تحسين الشارات */
    .badge {
        padding: 0.25rem 0.625rem;
        font-size: 0.8125rem;
    }

    /* تحسين Alerts */
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    /* تقليل المسافات */
    .mt-3 {
        margin-top: 1.25rem;
    }

    .mt-4 {
        margin-top: 1.75rem;
    }

    .mb-3 {
        margin-bottom: 1.25rem;
    }

    .mb-4 {
        margin-bottom: 1.75rem;
    }
}

/* Mobile Small (iPhones القديمة وهواتف صغيرة) */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .card {
        padding: 0.875rem;
    }

    /* أزرار أصغر قليلاً للشاشات الصغيرة جداً */
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .form-control {
        padding: 0.625rem 0.875rem;
    }

    /* جداول أصغر */
    table {
        font-size: 0.75rem;
    }

    thead th,
    tbody td {
        padding: 0.625rem 0.375rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.1875rem 0.5rem;
    }
}

@import url('notifications.css?v=2.0');