/* Private Banking UBS - Custom Styles */

:root {
    --color-primary: #125faf;
    --color-primary-dark: #0e4a8c;
    --color-primary-light: #3a7fd4;
    --color-platform: #125faf;
    --color-gold: #c5a059;
    --color-gold-dark: #9e7d3b;
    --color-emerald: #00875a;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;
    --color-bg: #f8f9fa;
    --color-bg-dark: #0f172a;
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    --color-sidebar: #ffffff;
    --color-sidebar-dark: #1e293b;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow: 0 0.5rem 1rem rgba(0,0,0,0.12);
    --shadow-modern: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --sidebar-width: 260px;
    --topbar-height: 56px;
}

/* Dark theme synchronization across data-theme, data-bs-theme, and body class */
[data-theme="dark"],
[data-bs-theme="dark"],
body.dark-theme {
    --color-bg: #0f172a;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-border: #334155;
    --color-sidebar: #1e293b;
    --color-primary: #3a7fd4;
    --color-primary-dark: #125faf;
    --color-platform: #3a7fd4;
    --bs-body-bg: #0f172a;
    --bs-body-color: #e2e8f0;
    --bs-card-bg: #1e293b;
    --bs-border-color: #334155;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 20px;
    padding-top: calc(var(--topbar-height) + 20px);
}

.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--color-sidebar);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 999;
}

/* Logo */
.logo {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
}

.logo img {
    max-height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

/* Sidebar menu */
.menu-section {
    padding: 15px 0;
}

.menu-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 8px 20px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(18, 95, 175, 0.1);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

.menu-item.active {
    background: rgba(18, 95, 175, 0.15);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

.menu-item i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.1rem;
}

/* Buttons */
.btn-platform {
    background-color: var(--color-platform);
    border-color: var(--color-platform);
    color: white;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-platform:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Cards */
.card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    background: var(--color-sidebar);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

/* Balance card */
.balance-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
}

.balance-card .balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.balance-card .balance-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Product cards */
.product-card {
    overflow: hidden;
    cursor: pointer;
}

.product-card .product-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.product-card .product-title {
    font-weight: 600;
    color: var(--color-text);
}

.product-card .product-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Tables */
.table {
    color: var(--color-text);
}

.table thead th {
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
}

.table-hover tbody tr:hover {
    background-color: rgba(18, 95, 175, 0.05);
}

/* Badges */
.badge-status {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Theme switch */
.theme-switch {
    padding: 10px 20px;
    border-bottom: 1px solid var(--color-border);
}

.theme-switch-input {
    cursor: pointer;
}

/* User menu offcanvas */
.offcanvas {
    background: var(--color-sidebar);
    color: var(--color-text);
}

.offcanvas-header {
    border-bottom: 1px solid var(--color-border);
}

#link-mon-compte {
    text-decoration: none;
    color: var(--color-text);
}

#link-mon-compte-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border);
}

#link-mon-compte-infos {
    display: flex;
    flex-direction: column;
}

#link-mon-compte-infos i {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

#link-mon-compte-etat {
    color: var(--color-success);
    font-size: 0.85rem;
}

#link-disconnect {
    display: block;
    padding: 15px 0;
    color: var(--color-danger);
    text-decoration: none;
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: 15px;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    max-height: 60px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-text);
    margin-bottom: 5px;
}

.login-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 30px;
}

/* Forms */
.form-control, .form-select {
    border-color: var(--color-border);
    background-color: var(--color-sidebar);
    color: var(--color-text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(18, 95, 175, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--color-text);
}

/* Admin specific */
.admin-sidebar .menu-item {
    font-size: 0.9rem;
}

.admin-card {
    margin-bottom: 20px;
}

/* Calendar */
.calendar {
    background: var(--color-sidebar);
    border-radius: 10px;
    overflow: hidden;
}

.calendar-header {
    background: var(--color-primary);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--color-border);
}

.calendar-day {
    background: var(--color-sidebar);
    padding: 10px;
    min-height: 80px;
    font-size: 0.85rem;
}

.calendar-day.today {
    background: rgba(18, 95, 175, 0.1);
    font-weight: 600;
}

.calendar-day.has-event {
    cursor: pointer;
}

.calendar-event {
    background: var(--color-primary);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        left: 0;
    }
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Trading components */
#dashboard-trade, #bourse-salle, #wallet-show, #back-positions-live {
    min-height: 400px;
}

/* Profit/loss colors */
.profit {
    color: var(--color-success);
    font-weight: 600;
}

.loss {
    color: var(--color-danger);
    font-weight: 600;
}

/* Slider */
.noUi-connect {
    background: var(--color-primary);
}

.noUi-handle {
    border-color: var(--color-primary);
}

/* Accordion */
.accordion-button:not(.collapsed) {
    background: rgba(18, 95, 175, 0.1);
    color: var(--color-primary);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-border);
    margin-top: 40px;
}

/* === SUBLIMATION DESIGN (Modern UI/UX) === */

/* Glassmorphism & Modern Shadows */
:root {
    --shadow-modern: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.top-bar, .topbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.3) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

[data-theme="dark"] .top-bar, [data-theme="dark"] .topbar {
    background: rgba(22, 33, 62, 0.85) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

/* Enhancing Cards */
.card {
    border: none;
    box-shadow: var(--shadow-modern);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
}

/* Gradient Buttons */
.btn-primary, .btn-platform {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border: none;
    box-shadow: 0 4px 6px rgba(18, 95, 175, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-platform:hover {
    box-shadow: 0 6px 12px rgba(18, 95, 175, 0.4);
    transform: translateY(-2px);
}

/* Sidebar styling */
.sidebar {
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    background: var(--color-sidebar);
}

.menu-item {
    margin: 4px 12px;
    border-radius: 8px;
    border-left: none !important;
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(18, 95, 175, 0.1) 0%, transparent 100%);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

/* Smooth Table Hover */
.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

/* Animated badges */
.badge-status, .badge {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Toast Notification Styling */
.toast-container {
    z-index: 1090;
}

.toast {
    backdrop-filter: blur(12px);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.bg-success {
    background: linear-gradient(135deg, #00875a 0%, #00a86b 100%) !important;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%) !important;
}

.toast.bg-primary {
    background: linear-gradient(135deg, #125faf 0%, #3a7fd4 100%) !important;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%) !important;
}

.toast.bg-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #31d2f2 100%) !important;
}

.toast-body {
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Digital Signature Pad */
.signature-container {
    border: 1px solid rgba(18, 95, 175, 0.25);
    background: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.signature-container:hover, .signature-container:focus-within {
    border-color: var(--color-primary);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04), 0 0 0 3px rgba(18, 95, 175, 0.15);
}

/* Forms Polish */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--color-border);
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(18, 95, 175, 0.15);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content {
    animation: fadeIn 0.35s ease-out forwards;
}

