/*
|--------------------------------------------------------------------------
| Public CMS Styles
|--------------------------------------------------------------------------
|
| Public-facing layout styles.
| Bourse/assets/css/public.css
|
*/

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #f5f7fb;
    margin: 0;
    direction: rtl;
    text-align: right;
}

/* Layout */

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (RIGHT) */

.sidebar {
    width: 240px;
    background: #243447;
    color: white;
    padding: 15px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
}

.sidebar-title {
    font-weight: bold;
    margin-bottom: 20px;
}

.sidebar a {
    display: block;
    color: #d6e0ea;
    padding: 10px;
    text-decoration: none;
    border-radius: 8px;
}

.sidebar a:hover {
    background: #34495e;
    color: white;
}

.sidebar a.active {
    background: #1987a8;
    color: #fff;
    font-weight: 600;
}

.sidebar-section.active {
    color: #1987a8;
    font-weight: 700;
}

.sidebar .disabled {
    display: block;
    padding: 10px 16px;
    color: #aeb8c2;
    cursor: not-allowed;
    opacity: .7;
    user-select: none;
}

.sidebar-section {
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #9fb0bf;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Main */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */

.topbar {
    background: #ffffff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #dfe6ed;
}

/* Content */

.content-wrapper {
    padding: 15px;
    width: 100%;
}

.content {
    padding: 20px;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
}

/* Card */

.card-box {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(36, 52, 71, 0.10);
    margin-bottom: 20px;
}

/* Page Title */

.page-title {
    margin-bottom: 20px;
}

.page-title h3 {
    margin: 0;
    font-weight: 700;
}

/* Table */

.table {
    margin-bottom: 0;
}

/* Buttons */

.btn {
    border-radius: 8px;
}

/* DataTables */

.dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_length {
    margin-bottom: 15px;
}


/* ======================================================
   Trade Guard Settings
   ====================================================== */

/* Divider */

.sidebar-settings-divider {
    border: 0;
    border-top: 1px solid #526477;
    margin: 22px 0 14px;
}

/* Panel */

.trade-guard-panel {
    direction: rtl;
    margin-top: 5px;
    border-radius: 10px;
    overflow: hidden;
}

.trade-guard-panel summary {
    direction: rtl;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;
    padding: 12px 11px;
    color: #e6edf4;
    cursor: pointer;
    list-style: none;
    border-radius: 9px;
    user-select: none;
    transition: background .2s ease;
}

.trade-guard-panel summary::-webkit-details-marker {
    display: none;
}

.trade-guard-panel summary:hover,
.trade-guard-panel[open] summary {
    background: #34495e;
    color: #fff;
}

.trade-guard-summary-icon {
    font-size: 17px;
    text-align: center;
}

.trade-guard-summary-title {
    text-align: right;
    font-size: 13px;
    font-weight: 600;
}

/* Chevron */

.trade-guard-chevron {
    width: 8px;
    height: 8px;
    justify-self: center;
    border-left: 2px solid #b9c8d6;
    border-bottom: 2px solid #b9c8d6;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.trade-guard-panel[open] .trade-guard-chevron {
    transform: rotate(135deg);
}

/* Panel Content */

.trade-guard-content {
    direction: rtl;
    margin: 5px 0 9px;
    padding: 15px 12px;
    background: #304458;
    border: 1px solid #40576c;
    border-radius: 10px;
}

.trade-guard-heading {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: right;
}

.trade-guard-description {
    color: #b9c8d6;
    font-size: 11px;
    line-height: 1.9;
    margin-bottom: 15px;
    text-align: right;
}

/* Options */

.trade-guard-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.trade-guard-option {
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 0;
    margin: 0;
    border-top: 1px solid rgba(220, 232, 242, .12);
    cursor: pointer;
}

.trade-guard-option-text {
    color: #e6edf4;
    font-size: 11.5px;
    line-height: 1.8;
    text-align: right;
}


/* ======================================================
   Toggle Switch
   ====================================================== */

.sidebar .trade-guard-switch {
    position: relative !important;
    display: inline-block !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 23px !important;
    direction: ltr !important;
    vertical-align: middle !important;
}

/* Hide Native Checkbox */

.sidebar .trade-guard-switch input[type="checkbox"] {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 42px !important;
    height: 23px !important;
    min-width: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    z-index: 2 !important;
}

/* Switch Track */

.sidebar .trade-guard-switch-track {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 42px !important;
    height: 23px !important;
    border-radius: 30px !important;
    background: #718096 !important;
    transition: background .2s ease !important;
    pointer-events: none !important;
}

/* Switch Handle */

.sidebar .trade-guard-switch-track::before {
    content: "" !important;
    position: absolute !important;
    display: block !important;
    width: 17px !important;
    height: 17px !important;
    left: 3px !important;
    top: 3px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    transform: none !important;
    transition: transform .2s ease !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.25) !important;
}

/* ON State */

.sidebar .trade-guard-switch input[type="checkbox"]:checked
+ .trade-guard-switch-track {
    background: #16a085 !important;
}

.sidebar .trade-guard-switch input[type="checkbox"]:checked
+ .trade-guard-switch-track::before {
    transform: translateX(19px) !important;
}

/* Keyboard Focus */

.sidebar .trade-guard-switch input[type="checkbox"]:focus-visible
+ .trade-guard-switch-track {
    outline: 2px solid #7dd3fc !important;
    outline-offset: 3px !important;
}

/* Disabled State */

.sidebar .trade-guard-switch input[type="checkbox"]:disabled {
    cursor: wait !important;
}

.sidebar .trade-guard-switch input[type="checkbox"]:disabled
+ .trade-guard-switch-track {
    opacity: .55 !important;
}


/* ======================================================
   Floating Notification Toast
   ====================================================== */

.trade-guard-toast {
    position: fixed !important;
    left: 24px !important;
    right: auto !important;
    bottom: 24px !important;
    top: auto !important;

    z-index: 2147483000 !important;

    display: flex !important;
    align-items: center !important;
    gap: 12px !important;

    direction: rtl !important;

    width: max-content !important;
    max-width: min(370px, calc(100vw - 32px)) !important;

    padding: 14px 18px !important;

    background: #fff !important;
    color: #243447 !important;

    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;

    box-shadow: 0 8px 30px rgba(15, 23, 42, .20) !important;

    opacity: 0 !important;
    visibility: hidden !important;

    transform: translateY(15px) !important;

    transition:
        opacity .22s ease,
        transform .22s ease,
        visibility .22s ease !important;

    pointer-events: none !important;
    box-sizing: border-box !important;
}

/* Visible */

.trade-guard-toast.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Icon */

.trade-guard-toast-icon {
    display: inline-flex !important;
    flex: 0 0 29px !important;
    width: 29px !important;
    height: 29px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

/* Message */

.trade-guard-toast-message {
    color: #243447 !important;
    font-size: 12px !important;
    line-height: 1.9 !important;
    text-align: right !important;
}

/* Success */

.trade-guard-toast.is-success {
    border-right: 4px solid #16a085 !important;
}

.trade-guard-toast.is-success .trade-guard-toast-icon {
    background: #e3f7ef !important;
    color: #12805f !important;
}

/* Error */

.trade-guard-toast.is-error {
    border-right: 4px solid #dc5555 !important;
}

.trade-guard-toast.is-error .trade-guard-toast-icon {
    background: #fdeaea !important;
    color: #c0392b !important;
}


/* ======================================================
   Responsive
   ====================================================== */

@media (max-width: 600px) {

    .trade-guard-toast {
        left: 12px !important;
        bottom: 12px !important;
        max-width: calc(100vw - 24px) !important;
    }

}
