/* =========================================================
   WhatsBox - Main Theme
   Font: Alexandria
   RTL Ready
   ========================================================= */

:root {
    --wb-font-family: 'Alexandria', sans-serif;

    --wb-bg: #f5f7fb;
    --wb-bg-soft: #fafbfc;
    --wb-white: #ffffff;

    --wb-text: #1f2937;
    --wb-text-soft: #6b7280;
    --wb-text-muted: #8a94a6;

    --wb-border: #e7ebf3;
    --wb-border-strong: #d7deea;

    --wb-primary: #198754;
    --wb-primary-hover: #157347;
    --wb-primary-soft: rgba(25, 135, 84, 0.08);

    --wb-dark: #111827;
    --wb-dark-soft: #1f2937;

    --wb-danger: #dc3545;
    --wb-warning: #f59e0b;
    --wb-info: #0ea5e9;
    --wb-success: #198754;

    --wb-shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.05);
    --wb-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --wb-shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.10);

    --wb-radius-sm: 10px;
    --wb-radius: 14px;
    --wb-radius-lg: 18px;
    --wb-radius-xl: 22px;

    --wb-transition: all 0.2s ease-in-out;
}

/* =========================================================
   Global
   ========================================================= */

html {
    font-size: 14px; /* أصغر قليلًا من الافتراضي */
    scroll-behavior: smooth;
}

body {
    font-family: var(--wb-font-family);
    background: linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
    color: var(--wb-text);
    font-size: 0.94rem;
    font-weight: 400;
    line-height: 1.75;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[dir="rtl"] body,
[dir="rtl"] .form-control,
[dir="rtl"] .form-select,
[dir="rtl"] .dropdown-menu,
[dir="rtl"] .dropdown-item,
[dir="rtl"] .dropdown-item-text,
[dir="rtl"] .card,
[dir="rtl"] .table,
[dir="rtl"] .alert,
[dir="rtl"] .modal-content {
    text-align: right;
}

a {
    color: var(--wb-primary);
    text-decoration: none;
    transition: var(--wb-transition);
}

a:hover {
    color: var(--wb-primary-hover);
}

img {
    max-width: 100%;
}

code,
pre,
.font-monospace {
    direction: ltr;
    text-align: left;
    font-size: 0.85rem;
}

hr {
    border-color: var(--wb-border);
    opacity: 1;
}

/* =========================================================
   Typography
   ========================================================= */

h1, h2, h3, h4, h5, h6,
.fw-bold,
.fw-semibold {
    font-family: var(--wb-font-family);
    letter-spacing: 0;
}

h1, .h1 { font-size: 1.85rem; font-weight: 700; }
h2, .h2 { font-size: 1.55rem; font-weight: 700; }
h3, .h3 { font-size: 1.35rem; font-weight: 700; }
h4, .h4 { font-size: 1.18rem; font-weight: 700; }
h5, .h5 { font-size: 1.03rem; font-weight: 700; }
h6, .h6 { font-size: 0.94rem; font-weight: 700; }

.small,
small {
    font-size: 0.82rem !important;
}

.display-6 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

/* =========================================================
   Layout Helpers
   ========================================================= */

.container-fluid {
    position: relative;
    z-index: 2;
}

.wb-main-wrapper {
    min-height: calc(100vh - 76px);
}

.wb-section-title {
    color: var(--wb-dark);
    font-weight: 800;
}

/* =========================================================
   Navbar / Header
   ========================================================= */

.wb-topbar,
.navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--wb-border);
    box-shadow: var(--wb-shadow-sm);
}

.navbar-brand {
    font-size: 1rem;
    color: var(--wb-dark) !important;
}

.navbar-brand small {
    font-size: 0.74rem;
    color: var(--wb-text-muted) !important;
}

.wb-logo-box {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1fb86a 0%, #198754 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(25, 135, 84, 0.22);
}

.navbar .nav-link {
    color: var(--wb-text-soft) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.72rem 0.95rem;
    border-radius: 12px;
    transition: var(--wb-transition);
}

.navbar .nav-link:hover {
    color: var(--wb-primary) !important;
    background: var(--wb-primary-soft);
}

.navbar .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, #1fb86a 0%, #198754 100%);
    box-shadow: 0 10px 20px rgba(25, 135, 84, 0.2);
}

.navbar-toggler {
    border: 0 !important;
    box-shadow: none !important;
}

/* =========================================================
   Cards
   ========================================================= */

.card {
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-radius-lg);
    background: var(--wb-white);
    box-shadow: var(--wb-shadow-sm);
    transition: var(--wb-transition);
}

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

.card-header,
.card-footer {
    background: transparent;
    border-color: var(--wb-border);
}

.wb-page-card {
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-radius-lg);
    box-shadow: var(--wb-shadow-sm);
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.68rem 1rem;
    transition: var(--wb-transition);
    box-shadow: none !important;
}

.btn-sm {
    font-size: 0.82rem;
    padding: 0.48rem 0.78rem;
    border-radius: 10px;
}

.btn-lg {
    font-size: 0.96rem;
    padding: 0.88rem 1.1rem;
    border-radius: 14px;
}

.btn-success,
.btn-primary {
    background: linear-gradient(135deg, #1fb86a 0%, #198754 100%);
    border-color: #198754;
}

.btn-success:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #1ca761 0%, #157347 100%);
    border-color: #157347;
    transform: translateY(-1px);
}

.btn-outline-success {
    color: var(--wb-primary);
    border-color: rgba(25, 135, 84, 0.25);
    background: #fff;
}

.btn-outline-success:hover {
    color: #fff;
    background: var(--wb-primary);
    border-color: var(--wb-primary);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
    border-width: 1px;
}

/* =========================================================
   Forms
   ========================================================= */

.form-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--wb-dark-soft);
    margin-bottom: 0.45rem;
}

.form-control,
.form-select {
    min-height: 44px;
    border: 1px solid var(--wb-border-strong);
    border-radius: 12px;
    background-color: #fff;
    color: var(--wb-text);
    font-size: 0.9rem;
    padding: 0.7rem 0.95rem;
    transition: var(--wb-transition);
    box-shadow: none !important;
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.form-control::placeholder,
.form-select::placeholder {
    color: #9aa4b2;
    opacity: 1;
}

.form-control:hover,
.form-select:hover {
    border-color: #c8d1df;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(25, 135, 84, 0.5);
    box-shadow: 0 0 0 0.22rem rgba(25, 135, 84, 0.12) !important;
}

.input-group-text {
    background: #fff;
    border: 1px solid var(--wb-border-strong);
    color: var(--wb-text-soft);
    border-radius: 12px;
    font-size: 0.9rem;
}

.form-text {
    color: var(--wb-text-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.form-check-input:checked {
    background-color: var(--wb-primary);
    border-color: var(--wb-primary);
}

/* =========================================================
   Alerts
   ========================================================= */

.alert {
    border: 0;
    border-radius: 14px;
    font-size: 0.9rem;
    box-shadow: var(--wb-shadow-sm);
}

.alert-success {
    background: #ecfdf3;
    color: #0f6a3d;
}

.alert-danger {
    background: #fff1f2;
    color: #b42318;
}

.alert-warning {
    background: #fff8e6;
    color: #9a6700;
}

.alert-info {
    background: #eef8ff;
    color: #0b69a3;
}

/* =========================================================
   Tables
   ========================================================= */

.table {
    --bs-table-bg: transparent;
    color: var(--wb-text);
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.82rem;
    color: var(--wb-text-soft);
    font-weight: 700;
    border-bottom-width: 1px;
    border-color: var(--wb-border);
    background: #fbfcfe;
    white-space: nowrap;
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.table tbody td {
    font-size: 0.88rem;
    vertical-align: middle;
    border-color: var(--wb-border);
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(25, 135, 84, 0.03);
}

.table-responsive {
    border-radius: 0 0 var(--wb-radius-lg) var(--wb-radius-lg);
}

/* =========================================================
   Badges
   ========================================================= */

.badge {
    font-weight: 600;
    font-size: 0.76rem;
    padding: 0.5rem 0.7rem;
    border-radius: 999px;
}

/* =========================================================
   Dropdowns / Menus
   ========================================================= */

.dropdown-menu {
    border: 1px solid var(--wb-border);
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: var(--wb-shadow-lg);
}

.dropdown-item,
.dropdown-item-text {
    font-size: 0.88rem;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--wb-primary-soft);
    color: var(--wb-primary);
}

/* =========================================================
   Footer
   ========================================================= */

footer {
    border-top: 1px solid var(--wb-border) !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

/* =========================================================
   Login Page
   ========================================================= */

.min-vh-100 .card {
    border-radius: 22px;
    box-shadow: var(--wb-shadow-lg);
}

.min-vh-100 .card .card-body {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* =========================================================
   Campaign Items
   ========================================================= */

.campaign-item-card {
    border: 1px solid var(--wb-border) !important;
    overflow: hidden;
}

.campaign-item-card .card-header {
    background: #f9fbfd !important;
    border-bottom: 1px solid var(--wb-border);
}

.campaign-item-card .item-number {
    color: var(--wb-primary);
    font-weight: 800;
}

/* =========================================================
   List Group
   ========================================================= */

.list-group-item {
    border-color: var(--wb-border);
    background: transparent;
}

/* =========================================================
   Utility Blocks
   ========================================================= */

.text-muted {
    color: var(--wb-text-muted) !important;
}

.text-break {
    word-break: break-word;
}

.bg-light {
    background-color: var(--wb-bg) !important;
}

.rounded-4 {
    border-radius: var(--wb-radius-lg) !important;
}

.shadow-sm {
    box-shadow: var(--wb-shadow-sm) !important;
}

.shadow {
    box-shadow: var(--wb-shadow-md) !important;
}

.border {
    border-color: var(--wb-border) !important;
}

/* =========================================================
   Scrollbar
   ========================================================= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #eef2f7;
}

::-webkit-scrollbar-thumb {
    background: #c4ccda;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aeb8c8;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 991.98px) {
    html {
        font-size: 13.5px;
    }

    .navbar .nav-link {
        margin-bottom: 0.3rem;
    }

    .display-6 {
        font-size: 1.7rem;
    }
}

@media (max-width: 767.98px) {
    html {
        font-size: 13px;
    }

    body {
        line-height: 1.7;
    }

    .btn-lg {
        padding: 0.82rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table thead th,
    .table tbody td {
        font-size: 0.84rem;
    }
}

/* =========================================================
   Focus Accessibility
   ========================================================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 0;
}

/* =========================================================
   Optional helpers for dashboard stats
   ========================================================= */

.stat-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wb-primary-soft);
    color: var(--wb-primary);
}

/* =========================================================
   Animation
   ========================================================= */

.card,
.btn,
.form-control,
.form-select,
.nav-link,
.alert {
    transition: var(--wb-transition);
}