﻿:root {
    --primary: #1976d2;
    --primary-light: #e3f2fd;
    --primary-dark: #1565c0;
    --bg: #f7fbff;
    --card: #fff;
    --text: #222;
    --border: #bbdefb;
    --sidebar-bg: #e3f2fd;
    --sidebar-text: #1976d2;
    --sidebar-hover: #bbdefb;
}

[data-theme="dark"] {
    --primary: #90caf9;
    --primary-light: #26334d;
    --primary-dark: #1976d2;
    --bg: #1a2233;
    --card: #26334d;
    --text: #f1f1f1;
    --border: #26334d;
    --sidebar-bg: #26334d;
    --sidebar-text: #bbdefb;
    --sidebar-hover: #1976d2;
}

/* Body & Layout */
body {
    padding-top: 120px;
    background-color: var(--bg);
    color: var(--text);
    font-family: Vazirmatn, sans-serif;
    transition: background-color 0.4s, color 0.4s;
}

    body.sidebar-open {
        transition: margin-right 0.3s cubic-bezier(.4,0,.2,1);
        margin-right: 240px;
    }

/* Header */
.header-bar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100vw;
    z-index: 1200;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 0 0 18px 18px;
    padding: 1rem 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    flex-wrap: wrap;
    gap: 1rem;
}

    .header-bar .text-primary {
        color: var(--primary) !important;
    }

.footer {
    z-index: 1203;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 18px 0 0 0;
    /*padding: 1rem 2rem;*/
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 15px;
    flex-wrap: wrap;
    gap: 1rem;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
}

main {
    margin-bottom: 30px !important;
}


.clinic-title {
    color: #222;
    font-weight: bold;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px #fff8, 0 0 2px #1976d222;
}

[data-theme="dark"] .clinic-title {
    color: #fff;
    text-shadow: 0 1px 2px #222a, 0 0 2px #1976d288;
}

/* Header Logo */
.header-logo img {
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(33,150,243,0.10);
    border: 3px solid var(--primary);
    background: var(--card);
    margin-bottom: 0.5rem;
    transition: border 0.3s;
}

/* Main Title */
.main-title {
    font-size: 28px;
    text-align: center;
    font-weight: bold;
    margin: 2rem 0 1rem;
}

/* Feature Box */
.feature-box {
    background-color: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

    .feature-box:hover {
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
    }

/* Auth Button */
.btn-auth {
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    transition: 0.3s ease;
}

    .btn-auth:hover {
        background: var(--primary-dark);
        color: #fff;
    }

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--primary);
    background: var(--card);
    border: none;
    border-radius: 50%;
    padding: 8px;
    transition: background 0.2s;
}

    .theme-toggle:hover {
        background: var(--primary-light);
    }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 120px;
    right: 0;
    width: 240px;
    height: calc(100vh - 120px);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 2rem 1rem 1rem 1rem;
    box-shadow: -4px 0 24px rgba(33, 150, 243, 0.08);
    border-radius: 20px 0 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1100;
    transition: background 0.3s, color 0.3s, width 0.3s, top 0.3s;
}

    .sidebar .sidebar-logo,
    .sidebar .logo {
        text-align: center;
        margin-bottom: 2rem;
        width: 100%;
    }

        .sidebar-logo img,
        .sidebar .logo img {
            width: 90px;
            height: 90px;
            object-fit: cover;
            border-radius: 50%;
            box-shadow: 0 2px 12px rgba(33,150,243,0.10);
            border: 3px solid var(--primary);
            background: var(--card);
            margin-bottom: 0.5rem;
            transition: border 0.3s;
        }

        .sidebar-title,
        .sidebar .logo h5 {
            margin-top: 0;
            font-weight: bold;
            color: var(--primary);
            font-size: 1.15rem;
            letter-spacing: 0.5px;
        }

    .sidebar nav {
        width: 100%;
    }

    .sidebar .nav-link {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding: 12px 16px;
        color: var(--sidebar-text);
        text-decoration: none;
        border-radius: 10px;
        font-weight: 500;
        margin-bottom: 8px;
        font-size: 1rem;
        transition: background 0.2s, color 0.2s, box-shadow 0.2s;
        box-shadow: none;
    }

        .sidebar .nav-link i {
            font-size: 1.25rem;
            opacity: 0.85;
        }

        .sidebar .nav-link:hover,
        .sidebar .nav-link.active {
            background: var(--sidebar-hover);
            color: #00ffff;
            box-shadow: 0 2px 8px rgba(33,250,243,0.08);
            text-decoration: underline wavy yellow;
        }

    .sidebar.hidden {
        transform: translateX(100%);
    }

/* Sidebar toggle button */
.btn-toggle-sidebar {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(33,150,243,0.12);
    transition: background 0.2s;
}

    .btn-toggle-sidebar:hover {
        background-color: var(--primary-dark);
    }

.sidebar-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1040;
}

    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

/* Modal */
.modal-content {
    background-color: var(--card);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 0.5rem;
}

.modal-header,
.modal-footer {
    border-color: rgba(0, 0, 0, 0.1);
}

.modal .form-control,
.modal .form-select {
    background-color: var(--card);
    color: var(--text);
    border: 1px solid #ced4da;
}

    .modal .form-control::placeholder {
        color: #999;
    }

.modal .btn-close {
    filter: invert(0);
}

[data-theme="dark"] .modal .btn-close {
    filter: invert(1);
}

/* Bootstrap-table*/
[data-theme="dark"] .bootstrap-table .table {
    background-color: #2a2a2a;
    color: #f1f1f1;
}

    [data-theme="dark"] .bootstrap-table .table thead th {
        background-color: #333;
        color: #f1f1f1;
    }

    [data-theme="dark"] .bootstrap-table .table tr.selected {
        background-color: #444 !important; /* رنگ پس‌زمینه قابل تشخیص */
        color: #fff !important; /* رنگ نوشته سفید */
    }

        /* اگه سلول‌ها هم رنگ گرفته بودن */
        [data-theme="dark"] .bootstrap-table .table tr.selected td {
            background-color: inherit !important;
            color: inherit !important;
        }

        [data-theme="dark"] .bootstrap-table .table tr.selected:hover {
            background-color: #555 !important;
        }

.bootstrap-table.bootstrap5 .float-left {
    float: right !important;
}


/* برای صفحه‌های کوچکتر از 576px */
@media (max-width: 576px) {
    .header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.5rem;
        min-height: unset;
    }

    .clinic-title {
        font-size: 1rem;
    }

    .header-bar .mobile-button-group {
        display: flex;
        justify-content: center;
        gap: 1rem;
    }

    .theme-toggle {
        font-size: 1.4rem;
        padding: 10px;
    }

    .sidebar {
        top: 220px;
    }
}

/* برای صفحه‌های کوچکتر از 991.98px */
@media (max-width: 991.98px) {
    .header-bar {
        border-radius: 0;
        padding: 1rem;
        min-height: 70px;
    }

    body {
        padding-top: 220px !important;
        padding-right: 0 !important;
    }

        body.sidebar-open {
            margin-right: 0 !important;
        }

    .sidebar {
        position: fixed;
        top: 210px;
        height: calc(100vh - 80px);
        width: 80vw;
        min-width: 180px;
        max-width: 320px;
        border-radius: 0 0 20px 20px;
        padding-top: 1.5rem;
        transition: transform 0.3s ease;
        z-index: 1100;
    }

        .sidebar .sidebar-logo,
        .sidebar .logo {
            margin-bottom: 1.2rem;
        }

    /*.user-profile-item {
        color: #222;
        font-size: 1rem;
        letter-spacing: 0.5px;
        text-shadow: 0 1px 2px #fff8, 0 0 2px #1976d222;*/
    /*text-decoration: none;*/
    /*}*/
}

/* برای صفحه‌های بزرگتر از 992px */
@media (min-width: 992px) {
    .btn-toggle-sidebar {
        right: 260px;
    }

    .sidebar.hidden {
        transform: translateX(100%);
    }

    .sidebar-backdrop {
        display: none !important;
    }

    .sidebar {
        position: fixed;
        top: 120px !important;
        height: calc(100vh - 120px);
        width: 240px;
        border-radius: 20px 0 0 20px;
        transform: translateX(0) !important; /* مطمئن شدن که نمایش دارد */
    }

        .sidebar.hidden {
            transform: translateX(100%) !important; /* وقتی مخفی هست */
        }
}

.fr {
    float: right;
}

.fl {
    float: left;
}
