/**
 * assets/css/style.css
 * نظام التصميم المتكامل لإدارة حضانة ومدرسة البسمة
 * مبني بمعايير Frontend UI Engineering & WCAG 2.1 AA
 */

:root {
    /* لوحة الألوان الأساسية - ألوان تعليمية هادئة واحترافية */
    --bs-primary: #1e40af; /* كحلي ملكي عميق */
    --bs-primary-rgb: 30, 64, 175;
    --primary-hover: #1d4ed8;
    --primary-subtle: #eff6ff;
    
    --bs-success: #059669; /* أخضر زمردي مالي */
    --success-subtle: #ecfdf5;
    
    --bs-warning: #d97706; /* عنبري دافئ */
    --warning-subtle: #fffbeb;
    
    --bs-danger: #e11d48; /* قرمزي أنيق */
    --danger-subtle: #fff1f2;
    
    --bs-info: #0284c7; /* أزرق سماوي */
    --info-subtle: #f0f9ff;

    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-muted: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

/* التنسيقات العامة والخطوط */
body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* شريط التنقل العلوي (Navbar) */
.main-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.navbar-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-icon-box {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.35rem;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.brand-title {
    font-weight: 800;
    font-size: 1.25rem;
    color: #0f172a;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-link-custom {
    color: #334155 !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link-custom:hover {
    background-color: var(--primary-subtle);
    color: var(--bs-primary) !important;
}

.nav-link-custom.active {
    background-color: var(--primary-subtle);
    color: var(--bs-primary) !important;
    font-weight: 700;
}

/* البطاقات والواجهات */
.card-custom {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-custom:hover {
    box-shadow: var(--shadow-md);
}

/* بطاقات الإحصائيات (Stat Cards) */
.metric-card {
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: var(--bs-primary);
}

.metric-card.success::before { background: var(--bs-success); }
.metric-card.warning::before { background: var(--bs-warning); }
.metric-card.danger::before { background: var(--bs-danger); }

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.metric-icon-circle.primary { background: var(--primary-subtle); color: var(--bs-primary); }
.metric-icon-circle.success { background: var(--success-subtle); color: var(--bs-success); }
.metric-icon-circle.warning { background: var(--warning-subtle); color: var(--bs-warning); }
.metric-icon-circle.danger  { background: var(--danger-subtle); color: var(--bs-danger); }

.metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

/* تحسين الجداول والصفوف */
.table-custom {
    margin-bottom: 0;
}

.table-custom th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table-custom td {
    padding: 1rem;
    vertical-align: middle;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92rem;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* أفاتار / رمز الطالب أو الموظف */
.avatar-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-left: 0.6rem;
}

/* شارات الحالة (Badges) */
.badge-pill-custom {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-paid { background-color: #dcfce7; color: #15803d; }
.badge-partial { background-color: #fef3c7; color: #b45309; }
.badge-unpaid { background-color: #fee2e2; color: #b91c1c; }
.badge-active { background-color: #e0f2fe; color: #0369a1; }
.badge-withdrawn { background-color: #f1f5f9; color: #475569; }

/* أزرار مخصصة وتفاعلية */
.btn-action-primary {
    background-color: var(--bs-primary);
    color: #ffffff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    border: none;
    transition: all 0.2s ease;
}

.btn-action-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.2);
}

.btn-whatsapp {
    background-color: #25d366;
    color: #ffffff;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    color: #ffffff;
    box-shadow: 0 3px 6px rgba(37, 211, 102, 0.3);
}

/* خانة البحث التفاعلية المباشرة */
.search-input-wrapper {
    position: relative;
    max-width: 320px;
}

.search-input-wrapper i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-custom {
    padding-right: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-custom:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
    outline: none;
}

/* طباعة الإيصالات (Print Styles) */
@media print {
    body * {
        visibility: hidden;
    }
    #printableReceipt, #printableReceipt * {
        visibility: visible;
    }
    #printableReceipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
        background: white;
    }
    .no-print {
        display: none !important;
    }
}
