/* ==========================================
   Theme System - Light & Dark Mode
   Primary Color: Sky Blue (#0ea5e9)
   Created: 2025-10-19
   ========================================== */

/* ========== Root Variables - Light Theme (Default) ========== */
:root {
    /* Primary Colors */
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-darker: #0369a1;
    --primary-light: #38bdf8;
    --primary-lighter: #7dd3fc;
    
    /* Background Colors */
    --bg-main: #fafbfc;
    --bg-secondary: #f3f4f6;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    --bg-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    --text-light: #d1d5db;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-light: #f3f4f6;
    --border: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Sidebar Colors */
    --sidebar-bg: #ffffff;
    --sidebar-profile-bg: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --sidebar-text: #4b5563;
    --sidebar-icon: #6b7280;
    --sidebar-hover-bg: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(14, 165, 233, 0.05) 100%);
    --sidebar-hover-text: #0ea5e9;
    --sidebar-active-bg: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --sidebar-active-text: #ffffff;
    --sidebar-submenu-bg: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    --sidebar-submenu-border: rgba(14, 165, 233, 0.1);
    
    /* Form Elements */
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-border-bottom: #e5e7eb;
    --input-hover-border: #38bdf8;
    --input-focus-border: #0ea5e9;
    --input-text: #374151;
    --input-placeholder: #9ca3af;
    --input-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --input-focus-ring: 0 0 0 3px rgba(14, 165, 233, 0.15);
    
    /* Button Colors */
    --btn-primary-bg: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --btn-primary-hover-bg: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #f3f4f6;
    --btn-secondary-hover-bg: #e5e7eb;
    --btn-secondary-text: #374151;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #065f46;
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-light-bg: rgba(16, 185, 129, 0.08);
    --warning: #fbbf24;
    --warning-light: #fef3c7;
    --warning-dark: #92400e;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --warning-light-bg: rgba(245, 158, 11, 0.08);
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #991b1b;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-light-bg: rgba(239, 68, 68, 0.08);
    --info: #60a5fa;
    --info-light: #dbeafe;
    --info-dark: #1e40af;
    --info-bg: rgba(96, 165, 250, 0.1);
    --info-light-bg: rgba(99, 102, 241, 0.08);
    --purple: #8b5cf6;
    --purple-light: #ddd6fe;
    --purple-dark: #5b21b6;
    
    /* Primary Light Background for Actions */
    --primary-light-bg: rgba(14, 165, 233, 0.08);
    
    /* Trade Colors - Buy/Sell */
    --trade-buy: #1d4ed8;
    --trade-buy-bg: rgba(29, 78, 216, 0.1);
    --trade-buy-border: rgba(29, 78, 216, 0.3);
    --trade-sell: #dc2626;
    --trade-sell-bg: rgba(220, 38, 38, 0.1);
    --trade-sell-border: rgba(220, 38, 38, 0.3);
    
    /* Alert Colors */
    --alert-success-bg: #d1fae5;
    --alert-success-border: #34d399;
    --alert-success-text: #065f46;
    --alert-warning-bg: #fef3c7;
    --alert-warning-border: #fbbf24;
    --alert-warning-text: #92400e;
    --alert-danger-bg: #fee2e2;
    --alert-danger-border: #f87171;
    --alert-danger-text: #991b1b;
    --alert-info-bg: #dbeafe;
    --alert-info-border: #60a5fa;
    --alert-info-text: #1e40af;
    
    /* Table Colors */
    --table-header-bg: #f9fafb;
    --table-border: #e5e7eb;
    --table-hover: #f3f4f6;
    --table-stripe: #fafbfc;
    
    /* Badge Colors */
    --badge-bg: #e5e7eb;
    --badge-text: #374151;
    
    /* Overlay Colors */
    --overlay: rgba(0, 0, 0, 0.5);
    --overlay-light: rgba(0, 0, 0, 0.25);
    
    /* Scrollbar Colors */
    --scrollbar-track: #f3f4f6;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;
}

/* ========== Dark Theme - Material Design Dark ========== */
[data-theme="dark"] {
    /* Primary Colors - Material Sky Blue */
    --primary: #03DAC6;
    --primary-dark: #018786;
    --primary-darker: #00574B;
    --primary-light: #66FFF9;
    --primary-lighter: #A7FFEB;
    
    /* Background Colors - Material Design */
    --bg-main: #2C2C2C;
    --bg-secondary: #1E1E1E;
    --bg-white: #1E1E1E;
    --bg-card: #3f3f3f;
    --bg-hover: #2C2C2C;
    --bg-gradient: linear-gradient(135deg, #03DAC6 0%, #018786 100%);
    
    /* Text Colors - Material Design */
    --text-primary: rgb(198 198 198 / 87%);
    --text-secondary: rgba(255, 255, 255, 0.60);
    --text-tertiary: rgba(255, 255, 255, 0.38);
    --text-muted: rgba(255, 255, 255, 0.38);
    --text-light: rgba(255, 255, 255, 0.12);
    --text-inverse: #000000;
    
    /* Border Colors - Material Design */
    --border-light: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-dark: rgba(255, 255, 255, 0.20);
    
    /* Shadow Colors - Material Design Elevation */
    --shadow-sm: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
    --shadow-md: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 12px 17px 2px rgba(0, 0, 0, 0.14), 0 5px 22px 4px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12);
    
    /* Sidebar Colors - Material Design Surface */
    --sidebar-bg: #2C2C2C;
    --sidebar-profile-bg: linear-gradient(135deg, #018786 0%, #00574B 100%);
    --sidebar-text: rgba(255, 255, 255, 0.87);
    --sidebar-icon: rgba(255, 255, 255, 0.60);
    --sidebar-hover-bg: rgba(3, 218, 198, 0.08);
    --sidebar-hover-text: #03DAC6;
    --sidebar-active-bg: linear-gradient(135deg, #03DAC6 0%, #018786 100%);
    --sidebar-active-text: #000000;
    --sidebar-submenu-bg: #2C2C2C;
    --sidebar-submenu-border: rgba(3, 218, 198, 0.2);
    
    /* Form Elements - Material Design */
    --input-bg: #2C2C2C;
    --input-border: rgba(255, 255, 255, 0.20);
    --input-border-bottom: rgba(255, 255, 255, 0.12);
    --input-hover-border: #03DAC6;
    --input-focus-border: #03DAC6;
    --input-text: rgba(255, 255, 255, 0.87);
    --input-placeholder: rgba(255, 255, 255, 0.38);
    --input-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2);
    --input-focus-ring: 0 0 0 3px rgba(3, 218, 198, 0.25);
    
    /* Button Colors - Material Design */
    --btn-primary-bg: linear-gradient(135deg, #03DAC6 0%, #018786 100%);
    --btn-primary-hover-bg: linear-gradient(135deg, #018786 0%, #00574B 100%);
    --btn-primary-text: #000000;
    --btn-secondary-bg: #2C2C2C;
    --btn-secondary-hover-bg: #383838;
    --btn-secondary-text: rgba(255, 255, 255, 0.87);
    
    /* Status Colors - Material Design */
    /* Softer, more readable status palette for dark mode */
    --success: #66BB6A;
    --success-light: #A5D6A7; /* lighter than success for fills */
    --success-dark: #388E3C;
    --success-bg: rgba(76, 175, 80, 0.15);
    --success-light-bg: rgba(76, 175, 80, 0.1);
    --success-dark-bg: rgba(76, 175, 80, 0.1);
    --warning: #FFB74D;
    --warning-light: #FFE0B2;
    --warning-dark: #F57C00;
    --warning-bg: rgba(255, 152, 0, 0.15);
    --warning-light-bg: rgba(255, 152, 0, 0.1);
    --warning-dark-bg: rgba(255, 152, 0, 0.1);
    --danger: #E57373;
    --danger-light: #FFCDD2;
    --danger-dark: #C62828;
    --danger-bg: rgba(207, 102, 121, 0.15);
    --danger-light-bg: rgba(207, 102, 121, 0.1);
    --danger-dark-bg: rgba(207, 102, 121, 0.1);
    --info: #64B5F6;
    --info-light: #BBDEFB;
    --info-dark: #1976D2;
    --info-bg: rgba(33, 150, 243, 0.15);
    --info-light-bg: rgba(187, 134, 252, 0.1);
    --info-dark-bg: rgba(187, 134, 252, 0.1);
    --purple: #BA68C8;
    --purple-light: #4A148C;
    --purple-dark: #CE93D8;
    
    /* Primary Light Background for Actions */
    --primary-light-bg: rgba(3, 218, 198, 0.1);
    --primary-dark-bg: rgba(3, 218, 198, 0.1);
    
    /* Trade Colors - Buy/Sell (نرم‌تر برای Dark Mode) */
    --trade-buy: #64B5F6;
    --trade-buy-bg: rgba(100, 181, 246, 0.15);
    --trade-buy-border: rgba(100, 181, 246, 0.3);
    --trade-sell: #EF9A9A;
    --trade-sell-bg: rgba(239, 154, 154, 0.15);
    --trade-sell-border: rgba(239, 154, 154, 0.3);
    
    /* Alert Colors - Material Design */
    --alert-success-bg: rgba(76, 175, 80, 0.12);
    --alert-success-border: #4CAF50;
    --alert-success-text: #81C784;
    --alert-warning-bg: rgba(255, 152, 0, 0.12);
    --alert-warning-border: #FF9800;
    --alert-warning-text: #FFB74D;
    --alert-danger-bg: rgba(207, 102, 121, 0.12);
    --alert-danger-border: #CF6679;
    --alert-danger-text: #EF9A9A;
    --alert-info-bg: rgba(33, 150, 243, 0.12);
    --alert-info-border: #2196F3;
    --alert-info-text: #64B5F6;
    
    /* Table Colors - Material Design Surface */
    --table-header-bg: #2C2C2C;
    --table-border: rgba(255, 255, 255, 0.05);
    --table-hover: #2C2C2C;
    --table-stripe: #4e4e4e;
    
    /* Badge Colors - Material Design */
    --badge-bg: #2C2C2C;
    --badge-text: rgba(255, 255, 255, 0.87);
    
    /* Overlay Colors - Material Design */
    --overlay: rgba(0, 0, 0, 0.6);
    --overlay-light: rgba(0, 0, 0, 0.32);
    
    /* Scrollbar Colors - Material Design */
    --scrollbar-track: #1E1E1E;
    --scrollbar-thumb: #2C2C2C;
    --scrollbar-thumb-hover: #383838;
}

/* ========== Smooth Theme Transition ========== */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========== Apply Theme Variables ========== */

/* Body */
body {
    background: var(--bg-main);
    color: var(--text-primary);
}

/* Sidebar */
.app-aside {
    background: var(--sidebar-bg) !important;
    box-shadow: var(--shadow-lg);
}

/* Sidebar Profile Card */
#aside-user {
    background: var(--sidebar-profile-bg);
}

/* Sidebar Toggle Button */
#aside-user .sidebar-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

[data-theme="dark"] #aside-user .sidebar-toggle {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-inverse);
}

/* Menu Items */
.navi .nav > li > a {
    color: var(--sidebar-text);
}

.navi .nav > li > a i.icon {
    color: var(--sidebar-icon);
}

.navi .nav > li > a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}

.navi .nav > li > a:hover i.icon {
    color: var(--sidebar-hover-text);
}

.navi .nav > li.active > a {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.navi .nav > li.active > a i.icon {
    color: var(--sidebar-active-text);
}

/* Submenu */
.nav-sub {
    background: var(--sidebar-submenu-bg);
    border-color: var(--sidebar-submenu-border);
}

.nav-sub li a {
    color: var(--sidebar-text);
}

.nav-sub li a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}

.nav-sub li a.current {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
    border-right-color: var(--primary);
}

/* Content Area */
.app-content {
    background: var(--bg-main);
}

/* Forms */
.form_box_bg {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}

.form_title {
    color: var(--text-primary);
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    background: var(--input-bg);
    border-color: var(--input-border);
    border-bottom-color: var(--input-border-bottom);
    color: var(--input-text);
    box-shadow: var(--input-shadow);
}

input::placeholder,
textarea::placeholder {
    color: var(--input-placeholder);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--input-hover-border);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-ring);
}

/* Buttons */
.btn-primary,
input[type="submit"],
button[type="submit"] {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-primary:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
    background: var(--btn-primary-hover-bg);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover-bg);
}

/* Tables */
table {
    background: var(--bg-card);
    color: var(--text-primary);
}

table thead {
    background: var(--table-header-bg);
    color: var(--text-primary);
}

table th,
table td {
    border-color: var(--table-border);
}

table tbody tr:hover {
    background: var(--table-hover);
}

table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}

/* Alerts */
.alert-success {
    background: var(--alert-success-bg);
    border-color: var(--alert-success-border);
    color: var(--alert-success-text);
}

.alert-warning {
    background: var(--alert-warning-bg);
    border-color: var(--alert-warning-border);
    color: var(--alert-warning-text);
}

.alert-danger {
    background: var(--alert-danger-bg);
    border-color: var(--alert-danger-border);
    color: var(--alert-danger-text);
}

.alert-info {
    background: var(--alert-info-bg);
    border-color: var(--alert-info-border);
    color: var(--alert-info-text);
}

/* Badges */
.badge,
.badge-type,
.status-badge {
    background: var(--badge-bg);
    color: var(--badge-text);
}

/* Cards & Boxes */
.box,
.panel,
.card,
.data_grid {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}

.box-header,
.panel-heading,
.card-header {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Menu Title */
.navi .nav > li.padder {
    color: var(--text-muted);
}

/* Mobile Overlay */
.mobile-overlay {
    background: var(--overlay);
}

/* Text Colors */
.text-muted {
    color: var(--text-muted) !important;
}

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

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

/* ========== Theme Toggle Button ========== */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    min-width: auto;
    width: auto;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .theme-toggle-btn {
    background: rgba(3, 218, 198, 0.2);
    border: 1px solid rgba(3, 218, 198, 0.3);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(3, 218, 198, 0.3);
}

/* Emoji Icons - مثل 💾 */
.theme-toggle-btn span {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.3s ease;
    display: inline-block;
}

.theme-toggle-btn:hover span {
    transform: scale(1.15);
}

/* Hide sun icon in light mode, moon icon in dark mode */
[data-theme="light"] .theme-icon-moon {
    display: inline-block;
}

[data-theme="light"] .theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: inline-block;
}

/* ========== Pagination Styles ========== */

/* Light Theme Pagination - Works with both .pagination div and ul.pagination */
.pagination,
ul.pagination {
    background: transparent !important;
}

.pagination li,
ul.pagination li {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

.pagination li a,
ul.pagination li a {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

.pagination li a:hover,
ul.pagination li a:hover {
    background: var(--bg-hover) !important;
    border-color: var(--primary-light) !important;
    color: var(--primary) !important;
}

.pagination li.active a,
ul.pagination li.active a {
    background: var(--bg-gradient) !important;
    border-color: var(--primary) !important;
    color: var(--text-inverse) !important;
}

.pagination li.disabled a,
ul.pagination li.disabled a {
    background: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
    opacity: 0.6;
}

/* Dark Theme Pagination - Specific Overrides */
[data-theme="dark"] .pagination,
[data-theme="dark"] ul.pagination {
    background: transparent !important;
}

[data-theme="dark"] .pagination li,
[data-theme="dark"] ul.pagination li {
    background: var(--bg-card) !important;
    border-color: var(--border-medium) !important;
}

[data-theme="dark"] .pagination li a,
[data-theme="dark"] ul.pagination li a {
    background: var(--bg-card) !important;
    border-color: var(--border-medium) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .pagination li a:hover,
[data-theme="dark"] ul.pagination li a:hover {
    background: var(--bg-hover) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

[data-theme="dark"] .pagination li.active a,
[data-theme="dark"] ul.pagination li.active a {
    background: var(--bg-gradient) !important;
    border-color: var(--primary) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .pagination li.disabled a,
[data-theme="dark"] ul.pagination li.disabled a {
    background: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
    opacity: 0.5;
}

/* Modern Pagination Styles */
.modern_pagination {
    background: var(--bg-main);
    border-top-color: var(--border);
}

.modern_pagination .pagination_info {
    color: var(--text-secondary);
}

.modern_pagination .pagination_links a,
.modern_pagination .pagination_links span {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}

.modern_pagination .pagination_links a:hover {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.modern_pagination .pagination_links span.current {
    background: var(--bg-gradient);
    color: var(--text-inverse);
    border-color: var(--primary);
}

[data-theme="dark"] .modern_pagination {
    background: var(--bg-main);
    border-top-color: var(--border-medium);
}

[data-theme="dark"] .modern_pagination .pagination_info {
    color: var(--text-secondary);
}

[data-theme="dark"] .modern_pagination .pagination_links a,
[data-theme="dark"] .modern_pagination .pagination_links span {
    background: var(--bg-card);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .modern_pagination .pagination_links a:hover {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

[data-theme="dark"] .modern_pagination .pagination_links span.current {
    background: var(--bg-gradient);
    color: var(--text-inverse);
    border-color: var(--primary);
}

/* ========== Profile Page Styles ========== */

/* Username Display Box */
.username-display {
    background: var(--alert-info-bg);
    padding: 14px 18px;
    border-radius: 8px;
    border-right: 4px solid var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.username-display strong {
    color: var(--text-primary);
    font-weight: 600;
}

.username-display span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Form Spacer */
.form-spacer {
    height: 24px;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .username-display {
    background: var(--alert-info-bg);
    border-right-color: var(--primary);
}

[data-theme="dark"] .username-display strong {
    color: var(--alert-info-text);
}

[data-theme="dark"] .username-display span {
    color: var(--text-primary);
}

/* ========== Modern Dashboard Styles ========== */

/* Dashboard Container */
.dashboard-modern {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 32px;
    text-align: center;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.dashboard-title .icon {
    font-size: 36px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.dashboard-subtitle {
    font-family: iransans;
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Stat Card Base */
.stat-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

/* Stat Card Icon */
.stat-card-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--bg-secondary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-card-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Stat Card Content */
.stat-card-content {
    flex: 1;
    z-index: 2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-description {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Stat Card Decoration */
.stat-card-decoration {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: 0.05;
    top: -100px;
    left: -50px;
    background: var(--primary);
    z-index: 0;
}

/* Stat Card Variants */
.stat-card-primary .stat-card-icon {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0.05) 100%);
    color: var(--primary);
}

.stat-card-primary .stat-card-decoration {
    background: var(--primary);
}

.stat-card-info .stat-card-icon {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%);
    color: #06b6d4;
}

.stat-card-info .stat-card-decoration {
    background: #06b6d4;
}

.stat-card-success .stat-card-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: var(--success);
}

.stat-card-success .stat-card-decoration {
    background: var(--success);
}

.stat-card-warning .stat-card-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: var(--warning);
}

.stat-card-warning .stat-card-decoration {
    background: var(--warning);
}

/* Dashboard Info Section */
.dashboard-info {
    margin-top: 32px;
}

.info-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0.05) 100%);
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.info-content p {
    font-family: iransans;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Dark Theme Specific Adjustments */
[data-theme="dark"] .stat-card-icon {
    background: var(--bg-secondary);
}

[data-theme="dark"] .stat-card-primary .stat-card-icon {
    background: rgba(3, 218, 198, 0.15);
    color: var(--primary);
}

[data-theme="dark"] .stat-card-info .stat-card-icon {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

[data-theme="dark"] .stat-card-success .stat-card-icon {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

[data-theme="dark"] .stat-card-warning .stat-card-icon {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

[data-theme="dark"] .info-icon {
    background: rgba(3, 218, 198, 0.15);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-modern {
        padding: 16px;
    }

    .dashboard-header {
        margin-bottom: 24px;
    }

    .dashboard-title {
        font-size: 24px;
    }

    .dashboard-title .icon {
        font-size: 28px;
    }

    .dashboard-subtitle {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .stat-card-icon {
        width: 64px;
        height: 64px;
        font-size: 36px;
    }

    .stat-value {
        font-size: 28px;
    }

    .info-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .info-icon {
        width: 64px;
        height: 64px;
        font-size: 36px;
    }
}

/* ========== Prevent Flash of Wrong Theme ========== */
html:not([data-theme]) {
    visibility: hidden;
}

html[data-theme] {
    visibility: visible;
}

/* ==========================================
   Trade Buy/Sell Colors
   رنگ‌های خرید و فروش
   ========================================== */

/* Trade Buy - خرید (آبی) */
.trade-buy,
.text-trade-buy {
    color: var(--trade-buy) !important;
}

.bg-trade-buy {
    background-color: var(--trade-buy-bg) !important;
    border-color: var(--trade-buy-border) !important;
}

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

/* Trade Sell - فروش (قرمز) */
.trade-sell,
.text-trade-sell {
    color: var(--trade-sell) !important;
}

.bg-trade-sell {
    background-color: var(--trade-sell-bg) !important;
    border-color: var(--trade-sell-border) !important;
}

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

/* Badge Styles */
.badge-trade-buy {
    background: var(--trade-buy-bg);
    color: var(--trade-buy);
    border: 1px solid var(--trade-buy-border);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
}

.badge-trade-sell {
    background: var(--trade-sell-bg);
    color: var(--trade-sell);
    border: 1px solid var(--trade-sell-border);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
}

/* Info Box with Trade Colors */
.info.trade-buy {
    background: var(--trade-buy-bg);
    color: var(--trade-buy);
    border-right: 3px solid var(--trade-buy);
    padding: 12px 16px;
    border-radius: 6px;
}

.info.trade-sell {
    background: var(--trade-sell-bg);
    color: var(--trade-sell);
    border-right: 3px solid var(--trade-sell);
    padding: 12px 16px;
    border-radius: 6px;
}

/* سازگاری با کلاس‌های قدیمی blue/red */
.info.blue {
    background: var(--trade-buy-bg);
    color: var(--trade-buy);
    border-right: 3px solid var(--trade-buy);
    padding: 12px 16px;
    border-radius: 6px;
}

.info.red {
    background: var(--trade-sell-bg);
    color: var(--trade-sell);
    border-right: 3px solid var(--trade-sell);
    padding: 12px 16px;
    border-radius: 6px;
}

/* ==========================================
   Sidebar Content Divider
   نقطه اتصال افقی بین Sidebar و Content
   ========================================== */
.sidebar-content-divider {
    position: fixed;
    top: 0;
    width: calc(100vw);
    height: 5px;
    background: linear-gradient(90deg, 
        var(--primary) 0%, 
        var(--primary-light) 50%, 
        var(--primary) 100%
    );
    z-index: 1015;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
}

/* Dark Mode */
[data-theme="dark"] .sidebar-content-divider {
    background: linear-gradient(90deg, 
        #03DAC6 0%, 
        #018786 50%, 
        #03DAC6 100%
    );
    box-shadow: 0 2px 10px rgba(3, 218, 198, 0.3);
}

/* ==========================================
   Wallet Summary Styles
   استایل‌های مدرن برای صفحه کیف پول
   ========================================== */
.wallet-summary {
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.wallet-summary-title {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.wallet-summary-title .btn {
    margin: 0;
}

.summary-item {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 10px 10px 0;
}

.summary-bep20::before {
    background: linear-gradient(180deg, #f7931e 0%, #ffc107 100%);
}

.summary-trc20::before {
    background: linear-gradient(180deg, #e74c3c 0%, #f44336 100%);
}

.summary-network-title {
    margin: 0 0 15px 0;
    font-size: 1.375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.summary-bep20 .summary-network-title {
    color: #f7931e;
}

.summary-trc20 .summary-network-title {
    color: #e74c3c;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.summary-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.summary-row span {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.summary-row strong {
    color: var(--text-primary);
    font-weight: 700;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
    font-size: 1.1875rem;
}

/* Bulk Actions */
.bulk_actions_wrapper {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
    display: none;
    animation: slideDown 0.3s ease;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk_actions_wrapper.show {
    display: block;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .wallet-summary {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .summary-item {
    background: var(--bg-main);
    border-color: var(--border);
}

[data-theme="dark"] .summary-bep20::before {
    background: linear-gradient(180deg, #ff9800 0%, #ffc107 100%);
}

[data-theme="dark"] .summary-trc20::before {
    background: linear-gradient(180deg, #f44336 0%, #e91e63 100%);
}

[data-theme="dark"] .summary-bep20 .summary-network-title {
    color: #ff9800;
}

[data-theme="dark"] .summary-trc20 .summary-network-title {
    color: #f44336;
}

[data-theme="dark"] .bulk_actions_wrapper {
    background: var(--bg-secondary);
    border-color: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .wallet-summary-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        font-size: 1.25rem;
    }
    
    .wallet-summary-title .btn {
        align-self: stretch;
        font-size: 1rem;
    }
    
    .summary-item {
        padding: 20px;
    }
    
    .summary-network-title {
        font-size: 1.25rem;
    }
    
    .summary-row span {
        font-size: 1rem;
    }
    
    .summary-row strong {
        font-size: 1.0625rem;
    }
    
    .summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .summary-row strong {
        align-self: flex-end;
    }
}

/* ==========================================
   Tether Transactions Summary Styles
   استایل‌های مدرن برای صفحه تتر
   ========================================== */
.tether-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tether-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

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

.tether-card-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.tether-buy-card .tether-card-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.tether-sell-card .tether-card-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.tether-balance-card .tether-card-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.tether-card-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.tether-card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.tether-card-body {
    padding: 1.5rem;
}

.tether-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.tether-stat-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tether-stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.tether-stat-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.125rem;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.tether-balance-item {
    padding: 1rem 0;
}

.tether-balance-value {
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg-secondary);
}

/* Profit/Loss Summary */
.tether-profit-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 2rem 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.tether-profit-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tether-profit-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.tether-profit-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.tether-profit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
}

.tether-profit-item {
    padding: 1.5rem;
    text-align: center;
    border-right: 1px solid var(--border-light);
    position: relative;
}

.tether-profit-item:last-child {
    border-right: none;
}

.tether-profit-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    border-radius: 2px;
}

.tether-permanent::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.tether-temp::before {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.tether-total::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.tether-profit-label {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
}

.tether-profit-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    font-family: 'Courier New', monospace;
    font-family: IRANSans, Tahoma, Arial, sans-serif !important;
    direction: ltr;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .tether-summary-card {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .tether-profit-summary {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .tether-balance-value {
    background: var(--bg-main);
}

/* Responsive */
@media (max-width: 768px) {
    .tether-summary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tether-card-header {
        padding: 1rem 1.25rem;
    }
    
    .tether-card-title {
        font-size: 1.125rem;
    }
    
    .tether-card-body {
        padding: 1.25rem;
    }
    
    .tether-stat-label {
        font-size: 0.9375rem;
    }
    
    .tether-stat-value {
        font-size: 1rem;
    }
    
    .tether-profit-grid {
        grid-template-columns: 1fr;
    }
    
    .tether-profit-item {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    
    .tether-profit-item:last-child {
        border-bottom: none;
    }
    
    .tether-profit-item::before {
        width: 80%;
    }
}

/* ==========================================
   Navigation Tabs - Profiling Pages
   استایل تب‌های ناوبری برای صفحات پروفایلینگ
   ========================================== */

/* Base Tab Container - Override Bootstrap */
.nav-tabs {
    border-bottom: 2px solid var(--border) !important;
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
}

/* Tab List Items */
.nav-tabs > li {
    margin-bottom: -2px;
    float: right; /* RTL support */
}

/* Tab Links - Default State */
.nav-tabs > li > a {
    padding: 12px 24px !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: block;
    position: relative;
    margin-right: 0;
    line-height: 1.6;
}

/* Tab Links - Hover State */
.nav-tabs > li > a:hover {
    color: var(--primary) !important;
    background: var(--bg-hover) !important;
    border-bottom-color: var(--primary-light) !important;
    border-color: transparent !important;
}

/* Active Tab */
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--primary) !important;
    background: var(--bg-card) !important;
    border: none !important;
    border-bottom: 3px solid var(--primary) !important;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    cursor: default;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--border-medium) !important;
}

[data-theme="dark"] .nav-tabs > li > a {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .nav-tabs > li > a:hover {
    color: var(--primary) !important;
    background: var(--bg-hover) !important;
    border-bottom-color: var(--primary) !important;
}

[data-theme="dark"] .nav-tabs > li.active > a,
[data-theme="dark"] .nav-tabs > li.active > a:hover,
[data-theme="dark"] .nav-tabs > li.active > a:focus {
    color: var(--primary) !important;
    background: var(--bg-card) !important;
    border-bottom-color: var(--primary) !important;
    box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-tabs > li > a {
        padding: 10px 16px !important;
        font-size: 14px;
    }
}