﻿/* wwwroot/css/site.css */

/* =========================================
   1. GLOBAL LAYOUT & FONTS
   ========================================= */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f8f9fa;
    margin-bottom: 60px;
}

/* =========================================
   2. NAVBAR & SIDEBAR (The Fix)
   ========================================= */
/* 1. الحاوية الأساسية فليكس */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch; /* القائمة والمحتوى بنفس الارتفاع */
}

/* 2. القائمة الجانبية (Sticky Mode للكمبيوتر) */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    height: 100vh; /* طول الشاشة */
    position: sticky; /* تثبيت ذكي */
    top: 0;
    left: 0;
    overflow-y: auto; /* تفعيل السكرول الداخلي */
    z-index: 1000;
    background: #1e1e2d;
    color: #fff;
    transition: all 0.3s;
    scrollbar-width: thin;
    scrollbar-color: #6c757d #1e1e2d;
}

/* 3. المحتوى الرئيسي */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    margin: 0; /* لا حاجة لأي مارجن، الفليكس يرتبهم */
}

/* 4. تعديلات الموبايل (Mobile Mode) */
/* دمجنا التكرار هنا في بلوك واحد */
@media (max-width: 768px) {
    #sidebar {
        /* في الموبايل تصبح القائمة طافية فوق المحتوى */
        position: fixed;
        margin-left: -250px; /* إخفاء افتراضي */
        height: 100%;
    }

        #sidebar.active {
            margin-left: 0; /* إظهار عند التفعيل */
        }

    #content {
        margin: 0;
    }
}

/* 5. طبقة التعتيم (Overlay) للموبايل */
.overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: all 0.5s ease-in-out;
}

    .overlay.active {
        display: block;
        opacity: 1;
    }

/* =========================================
   3. FOOTER
   ========================================= */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    text-align: center;
    color: #6c757d;
}

/* =========================================
   4. CARDS (For Forms & Dashboard)
   ========================================= */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,.05);
    font-weight: 700;
    padding: 1rem 1.25rem;
}

/* =========================================
   5. TABLES & IMAGES
   ========================================= */
.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    background-color: #f1f3f5;
    border-bottom: 2px solid #dee2e6;
}

.img-thumbnail-custom {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* =========================================
   6. UTILITIES
   ========================================= */
.table > tbody > tr > td {
    vertical-align: middle;
}


/* =========================================
   6. MODERN TOAST NOTIFICATION
   ========================================= */
.custom-toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e1e2d;
    color: #fff;
    padding: 10px 20px; /* تقليل الحواف لتصبح أنعم */
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    
    /* التعديل هنا: إزالة العرض الإجباري */
    min-width: auto; 
    width: fit-content; /* العرض على قد الكلام بالضبط */
    max-width: 80%; /* لضمان عدم تجاوز الشاشة في الموبايل */
    white-space: nowrap; /* إجبار النص على سطر واحد */
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .custom-toast.show {
        top: 30px; /* النزول للأسفل عند التفعيل */
        opacity: 1;
        visibility: visible;
    }

.toast-icon {
    width: 35px;
    height: 35px;
    background: #00d25b; /* Success Green */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}


