﻿/* wwwroot/css/app-ui.css */

/* ===== RTL base ===== */
html, body {
    direction: rtl;
}

body {
    background: #f6f7fb;
}

/* ===== Theme gradient (كما عندك) ===== */
.backgroundimage {
    background-image: linear-gradient(180deg, #166a6e 0%, #3a0647 70%);
}

/* ===== Icon button ===== */
.icon-button {
    background: #0c5c82;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 8px 10px;
    margin: 4px;
    cursor: pointer;
    transition: transform .2s, background-color .2s;
    font-size: 1.1rem;
    position: relative;
}

    .icon-button:hover {
        transform: scale(1.05);
        background-color: #1a8fbf;
    }

/* Badge */
.badge {
    background: #dc3545;
    color: white;
    border-radius: 12px;
    padding: .15em .45em;
    font-size: .8em;
    margin-left: 6px;
}

/* ===== Layout shell ===== */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}

/* Layout body (sidebar + content) */
.layout-body {
    flex: 1;
    display: flex;
    min-height: calc(100vh - 3.5rem);
}

/* ===== Sidebar ===== */
.sidebar {
    width: 250px;
    height: calc(100vh - 3.5rem);
    position: sticky;
    top: 3.5rem;
    overflow: auto;
    transition: width .2s ease, transform .2s ease;
    border-left: 1px solid rgba(255,255,255,.08); /* RTL */
}

    /* Desktop collapsed (قابل للإغلاق) */
    .sidebar.desktop-collapsed {
        width: 0;
        overflow: hidden;
        border-left: none;
    }

/* Content */
.content {
    flex: 1;
    padding: 16px;
    overflow: auto;
}

/* ===== Mobile behavior ===== */
.sidebar-overlay {
    display: none;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 3.5rem;
        bottom: 0;
        right: 0;
        z-index: 1040;
        transform: translateX(110%);
        width: 280px;
        height: auto;
    }

        .sidebar.open {
            transform: translateX(0%);
        }

        .sidebar.desktop-collapsed {
            /* على الموبايل الإغلاق يكون بالانزلاق وليس width=0 */
            width: 280px;
        }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 3.5rem;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.35);
        z-index: 1030;
    }
}

/* ===== Card-like menu (الصفحات الرئيسية عندك) ===== */
.mb-6 .card-like {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 140px;
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-image: linear-gradient(180deg, #166a6e 0%, #3a0647 70%);
    color: white;
    transition: transform .2s;
    text-decoration: none;
}

    .mb-6 .card-like:hover {
        transform: scale(1.05);
    }

    .mb-6 .card-like i {
        font-size: 3em;
        margin-bottom: 5px;
    }

.mb-6 .m-3 a {
    text-decoration: none;
}

/* ===== Tables ===== */
.table {
    min-width: max-content;
}

.table-responsive {
    overflow-x: auto;
}
