﻿/* =========================================
   1. Imports & Variables
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* ألوان اللوجو (MSC Blue Palette) */
    --main-color: #0077b6; /* أزرق أساسي */
    --dark-blue: #023e8a; /* أزرق داكن */
    --light-blue: #e0f7fa; /* أزرق فاتح للخلفيات */
    --hover-blue: #caf0f8; /* لون الهافر */
    --accent-color: #00b4d8; /* لون التمييز */
    --text-color: #333;
    --text-muted: #6c757d;
    --white: #ffffff;
    --transition: all 0.3s ease-in-out;
}

/* =========================================
   2. Global Styles
   ========================================= */
html, body {
    height: 100%;
    font-family: 'Tajawal', sans-serif;
    background-color: #f0f8ff; /* خلفية الصفحة */
    color: var(--text-color);
    direction: rtl;
    text-align: right;
}

body {
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none !important;
    transition: var(--transition);
}

/* سكرول بار */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #eef2f3;
}

::-webkit-scrollbar-thumb {
    background: var(--main-color);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--dark-blue);
    }

/* =========================================
   3. Navbar (Header)
   ========================================= */
.navbar {
    background: linear-gradient(135deg, var(--dark-blue), var(--main-color));
    box-shadow: 0 4px 20px rgba(0, 119, 182, 0.2);
    padding: 0.8rem 1rem;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--white) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: 1.05rem;
    margin: 0 5px;
    border-radius: 8px;
    padding: 8px 15px !important;
    transition: all 0.3s;
}

    .nav-link:hover, .nav-link.active {
        background-color: rgba(255, 255, 255, 0.15);
        color: var(--white) !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

/* =========================================
   4. Tabs (New Fix) - إصلاح التابات
   ========================================= */
/* =========================================
   4. Tabs (Fix for Inactive Visibility)
   ========================================= */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

    /* التاب غير النشط (Inactive) - ده اللي كان مختفي */
    .nav-tabs .nav-link {
        color: #444 !important; /* <<--- خلينا لونه رمادي غامق واضح جداً */
        background-color: #f8f9fa; /* خلفية رصاصي خفيف جداً عشان يبان إنه زرار */
        border: 1px solid transparent;
        border-bottom: none;
        margin-right: 4px;
        font-weight: 700; /* خط عريض عشان يكون ظاهر */
        transition: all 0.3s ease;
    }

        /* عند الوقوف بالماوس (Hover) */
        .nav-tabs .nav-link:hover {
            color: var(--main-color) !important; /* يتحول للأزرق */
            background-color: #e9ecef; /* يغمق الخلفية سنة بسيطة */
            border-color: #e9ecef #e9ecef #dee2e6;
            transform: translateY(-2px); /* حركة خفيفة لفوق */
        }

        /* التاب النشط (Active) - اللي أنا واقف عليه */
        .nav-tabs .nav-link.active {
            color: var(--main-color) !important; /* أزرق */
            background-color: #fff !important; /* خلفية بيضاء تدمج مع المحتوى */
            border-color: #dee2e6 #dee2e6 #fff; /* حدود عشان يبان مفتوح */
            border-top: 3px solid var(--main-color) !important; /* الخط الأزرق اللي فوق */
        }

/* =========================================
   5. Cards
   ========================================= */
/* الكارت العام (Bootstrap Overwrite) */
.card {
    border: none;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

/* الكارت الأبيض النظيف (Custom) */
.clean-card {
    background: #ffffff;
    border: 1px solid rgba(0, 119, 182, 0.05);
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.05);
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .clean-card:hover, .hover-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 35px rgba(0, 119, 182, 0.15);
    }

    .clean-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: linear-gradient(90deg, var(--main-color), var(--accent-color));
        opacity: 0;
        transition: opacity 0.3s;
    }

    .clean-card:hover::before {
        opacity: 1;
    }

/* =========================================
   6. Buttons & Actions
   ========================================= */
.btn-primary {
    background: linear-gradient(135deg, var(--main-color), var(--dark-blue));
    border: none;
    box-shadow: 0 4px 10px rgba(0, 119, 182, 0.3);
}

    .btn-primary:hover {
        background: linear-gradient(135deg, var(--dark-blue), var(--main-color));
        transform: translateY(-2px);
    }

.text-primary {
    color: var(--main-color) !important;
}

/* أزرار الإجراءات الدائرية */
.btn-action {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

    .btn-action.edit {
        background-color: #e1f5fe;
        color: var(--main-color);
    }

        .btn-action.edit:hover {
            background-color: var(--main-color);
            color: #fff;
        }

    .btn-action.delete {
        background-color: #ffebee;
        color: #e63946;
    }

        .btn-action.delete:hover {
            background-color: #e63946;
            color: #fff;
        }

/* =========================================
   7. Tables
   ========================================= */
.table-custom {
    margin-bottom: 0;
}

    .table-custom thead th {
        background-color: #f1f9fc;
        color: var(--dark-blue);
        font-weight: 700;
        border-bottom: 2px solid #b3e5fc;
        padding: 15px;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .table-custom tbody td {
        padding: 12px 15px;
        vertical-align: middle;
        border-bottom: 1px solid #e1f5fe;
        color: #444;
        font-weight: 500;
        font-size: 0.9rem;
    }

.table-hover > tbody > tr:hover > * {
    background-color: var(--hover-blue) !important;
    color: var(--dark-blue);
    transition: background-color 0.2s ease;
}

/* =========================================
   8. Footer
   ========================================= */
.footer {
    background-color: var(--dark-blue);
    color: #e0e0e0;
    padding: 40px 0 20px 0;
    margin-top: auto;
    font-size: 0.9rem;
    position: relative;
}

    .footer a {
        color: #b0c4de;
        margin-bottom: 12px;
        display: block;
    }

        .footer a:hover {
            color: var(--white);
            padding-right: 8px;
        }

/* =========================================
   9. Responsive & Animations
   ========================================= */
@media screen and (max-width: 768px) {
    .table-custom thead {
        display: none;
    }

    .table-custom tr {
        display: block;
        background-color: var(--white);
        margin-bottom: 20px;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 119, 182, 0.08);
        border: 1px solid rgba(0, 119, 182, 0.1);
        padding: 10px 0;
    }

    .table-custom td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 12px 20px;
        border-bottom: 1px solid #f0f8ff;
    }

        .table-custom td::before {
            content: attr(data-label);
            font-weight: 800;
            color: var(--main-color);
            margin-left: 15px;
            font-size: 0.85rem;
        }

        .table-custom td:last-child {
            border-bottom: none;
            justify-content: center;
            gap: 15px;
            padding-top: 20px;
            border-top: 2px dashed #e1f5fe;
        }
    /* أزرار الموبايل */
    .btn-action {
        width: auto !important;
        height: auto !important;
        padding: 8px 18px !important;
        border-radius: 50px !important;
        font-size: 0.85rem;
        display: flex !important;
        gap: 8px;
    }

        .btn-action span {
            display: inline-block !important;
        }
}

@media screen and (min-width: 769px) {
    .btn-action span {
        display: none;
    }
}

/* Animations */
.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate.slideIn {
    animation: slideIn 0.3s ease forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
