/* ============================================
   Trading Platform - Professional Dark Theme
   ============================================ */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    --border-color: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-green: #00d26a;
    --accent-green-dark: #00a854;
    --accent-red: #ff4757;
    --accent-red-dark: #d63447;
    --accent-blue: #58a6ff;
    --accent-gold: #ffd700;
    --accent-orange: #f0883e;
    --gradient-green: linear-gradient(135deg, #00d26a 0%, #00a854 100%);
    --gradient-red: linear-gradient(135deg, #ff4757 0%, #d63447 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.history-modal {
    max-width: 1000px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.modal-header h2 i {
    color: var(--accent-blue);
}

.close-modal {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    background: var(--accent-red);
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Terms Modal */
.warning-box {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.warning-box i {
    font-size: 2.5rem;
    color: var(--accent-red);
    margin-bottom: 10px;
}

.warning-box h3 {
    color: var(--accent-red);
    font-size: 1.1rem;
}

.terms-content {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.terms-content h4 {
    color: var(--accent-blue);
    margin: 16px 0 8px;
    font-size: 1rem;
}

.terms-content h4:first-child {
    margin-top: 0;
}

.terms-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}

.terms-content ul {
    margin: 8px 0 16px 20px;
    color: var(--text-secondary);
}

.terms-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.terms-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--accent-green);
}

.terms-checkbox label {
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-accept {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-accept:not(:disabled) {
    background: var(--gradient-green);
    color: white;
    cursor: pointer;
}

.btn-accept:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 210, 106, 0.4);
}

/* About Modal */
.about-section {
    text-align: center;
}

.about-logo {
    margin-bottom: 20px;
}

.about-logo i {
    font-size: 3rem;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.about-logo h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.about-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.feature-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.feature-item i {
    font-size: 2rem;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.feature-item h4 {
    color: var(--text-primary);
    margin-bottom: 6px;
}

.feature-item p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.risk-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 10px;
    padding: 16px;
    text-align: right;
}

.risk-warning i {
    color: var(--accent-red);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.risk-warning p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* History Modal */
.history-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-card i {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.profit i {
    background: rgba(0, 210, 106, 0.1);
    color: var(--accent-green);
}

.stat-card.loss i {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-red);
}

.stat-card.trades i {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
}

.stat-card.winrate i {
    background: rgba(240, 136, 62, 0.1);
    color: var(--accent-orange);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead {
    background: var(--bg-tertiary);
}

.history-table th,
.history-table td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.history-table td {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.history-table .empty-row td {
    padding: 40px;
    color: var(--text-muted);
}

.result-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.result-badge.win {
    background: rgba(0, 210, 106, 0.1);
    color: var(--accent-green);
}

.result-badge.loss {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-red);
}

/* ============================================
   Header Styles
   ============================================ */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 70px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-links a.active {
    color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Account Type Indicator */
.account-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid;
}

.account-indicator.demo {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.account-indicator.real {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.account-indicator:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.balance-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-tertiary);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.balance-card:hover {
    border-color: var(--accent-blue);
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.balance-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-value.profit {
    color: var(--accent-green);
}

.balance-value.loss {
    color: var(--accent-red);
}

.currency {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.balance-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--gradient-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    position: relative;
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 55px;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1000;
    animation: slideDown 0.2s ease;
}

.user-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.user-info small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0 8px;
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-red);
}

.dropdown-item i {
    font-size: 1rem;
}

/* ============================================
   Market Info Bar
   ============================================ */

.market-info-bar {
    display: flex;
    gap: 24px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.market-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    white-space: nowrap;
}

.market-name {
    font-weight: 600;
    color: var(--text-primary);
}

.market-price {
    font-weight: 700;
}

.market-price.up {
    color: var(--accent-green);
}

.market-price.down {
    color: var(--accent-red);
}

.market-change {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.market-change.up {
    color: var(--accent-green);
    background: rgba(0, 210, 106, 0.1);
}

.market-change.down {
    color: var(--accent-red);
    background: rgba(255, 71, 87, 0.1);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    padding: 20px;
}

.trading-container {
    display: grid;
    grid-template-columns: 320px 1fr 380px;
    gap: 20px;
    margin-bottom: 20px;
    align-items: start;
}

/* ============================================
   Chart Section
   ============================================ */

.chart-section {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.pair-selector {
    display: flex;
    gap: 8px;
}

.pair-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.pair-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.pair-btn.active {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.pair-icon {
    font-size: 1.2rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeframe-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.tf-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.tf-btn:hover {
    color: var(--text-primary);
}

.tf-btn.active {
    background: var(--accent-blue);
    color: white;
}

.chart-tools {
    display: flex;
    gap: 4px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.tool-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.chart-wrapper {
    position: relative;
    padding: 20px;
    height: 500px;
}

.price-info {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.candle-timer {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.timer-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: 'Courier New', monospace;
}

.current-price {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-change {
    font-size: 1rem;
    font-weight: 600;
}

.price-change.up {
    color: var(--accent-green);
}

.price-change.down {
    color: var(--accent-red);
}

#candlestick-chart {
    width: 100%;
    height: 100%;
}

.volume-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   Trading Panel
   ============================================ */

.trading-panel {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.pair-name {
    color: var(--accent-blue);
    font-weight: 600;
}

.price-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.bid-price, .ask-price {
    text-align: center;
}

.bid-price .label, .ask-price .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.bid-price .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-red);
}

.ask-price .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-green);
}

.spread {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Duration Section */
.duration-section {
    display: flex;
    flex-direction: column;
}

.section-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 600;
}

.duration-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.duration-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
}

.duration-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.duration-btn.active {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.custom-duration {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-duration input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
}

.custom-duration input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.custom-duration span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.lot-section {
    display: flex;
    flex-direction: column;
}

.lot-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.lot-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.lot-btn:hover {
    background: var(--border-color);
    border-color: var(--accent-blue);
}

.lot-input-container {
    flex: 1;
    position: relative;
}

.lot-input-container input {
    width: 100%;
    height: 44px;
    padding: 0 50px 0 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    text-align: center;
}

.lot-input-container input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.lot-currency {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.quick-lots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-lot-btn {
    flex: 1;
    min-width: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
}

.quick-lot-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.quick-lot-btn.active {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Potential Return */
.potential-return {
    background: rgba(0, 210, 106, 0.1);
    border: 1px solid var(--accent-green);
    border-radius: 10px;
    padding: 12px 16px;
}

.return-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.return-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.return-value {
    color: var(--accent-green);
    font-size: 1.1rem;
    font-weight: 700;
}

.trade-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.trade-btn {
    padding: 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'Cairo', sans-serif;
}

.trade-btn.sell {
    background: var(--gradient-red);
    color: white;
}

.trade-btn.buy {
    background: var(--gradient-green);
    color: white;
}

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

.trade-btn:active {
    transform: translateY(0);
}

.trade-btn.clicked {
    transform: scale(0.95);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-price {
    font-size: 0.85rem;
    opacity: 0.9;
}

.trade-info {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

/* ============================================
   Positions Section (Old - kept for history modal)
   ============================================ */

.positions-section {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* ============================================
   Positions Sidebar (Right Side)
   ============================================ */

.positions-sidebar {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: fit-content;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.positions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.positions-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.positions-tabs {
    display: flex;
    gap: 8px;
}

.pos-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.pos-tab:hover {
    color: var(--text-primary);
}

.pos-tab.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pos-tab .count {
    background: var(--accent-blue);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 4px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

/* Positions List (for sidebar) */
.positions-list {
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.positions-list::-webkit-scrollbar {
    width: 6px;
}

.positions-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.positions-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.positions-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Position Card (for sidebar) */
.position-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    animation: slideUp 0.3s ease;
    transition: var(--transition);
}

.position-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

.position-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.position-card-pair {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.position-card-type {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.position-card-type.buy {
    background: rgba(0, 210, 106, 0.1);
    color: var(--accent-green);
}

.position-card-type.sell {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-red);
}

.position-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.position-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.position-card-label {
    color: var(--text-secondary);
}

.position-card-value {
    color: var(--text-primary);
    font-weight: 600;
}

.position-card-timer {
    color: var(--accent-orange);
    font-weight: 700;
}

.position-card-pnl.profit {
    color: var(--accent-green);
    font-weight: 700;
}

.position-card-pnl.loss {
    color: var(--accent-red);
    font-weight: 700;
}

.positions-table {
    padding: 0 20px 20px;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 0.7fr 1fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.position-row {
    display: grid;
    grid-template-columns: 1fr 0.7fr 1fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    font-size: 0.9rem;
    animation: slideUp 0.3s ease;
}

.position-row:last-child {
    border-bottom: none;
}

.position-row .pair {
    font-weight: 700;
    color: var(--text-primary);
}

.position-row .type {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
}

.position-row .type.buy {
    background: rgba(0, 210, 106, 0.1);
    color: var(--accent-green);
}

.position-row .type.sell {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-red);
}

.position-row .timer {
    font-weight: 600;
    color: var(--accent-orange);
}

.position-row .pnl.profit {
    color: var(--accent-green);
    font-weight: 700;
}

.position-row .pnl.loss {
    color: var(--accent-red);
    font-weight: 700;
}

.empty-positions {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-positions i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-positions p {
    font-size: 0.95rem;
}

/* ============================================
   Toast Notification
   ============================================ */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--accent-green);
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast i {
    color: var(--accent-green);
    font-size: 1.2rem;
}

/* ============================================
   Trade Markers on Chart
   ============================================ */

.trade-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    animation: pulse 2s infinite;
    z-index: 5;
}

.trade-marker.buy {
    background: var(--accent-green);
    box-shadow: 0 0 20px rgba(0, 210, 106, 0.5);
}

.trade-marker.sell {
    background: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

@media (max-width: 1400px) {
    .trading-container {
        grid-template-columns: 280px 1fr 350px;
    }
}

@media (max-width: 1200px) {
    .trading-container {
        grid-template-columns: 1fr 350px;
    }

    .positions-sidebar {
        order: 2;
        max-height: 500px;
    }

    .chart-section {
        order: 1;
        grid-column: 1 / -1;
    }

    .trading-panel {
        order: 3;
    }

    .history-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .trading-container {
        grid-template-columns: 1fr;
    }

    .positions-sidebar {
        order: 3;
        max-height: 400px;
    }

    .chart-section {
        order: 1;
    }

    .trading-panel {
        order: 2;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .header {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 12px;
    }

    .header-right, .header-left {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .balance-card {
        flex-direction: row;
        gap: 12px;
        padding: 10px 12px;
        min-width: auto;
    }

    .balance-item {
        flex: 1;
    }

    .balance-amount {
        font-size: 1rem;
    }

    .balance-divider {
        width: 1px;
        height: 30px;
    }

    .main-content {
        padding: 10px;
    }

    .market-info-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 12px;
        padding: 8px 10px;
        -webkit-overflow-scrolling: touch;
    }

    .market-item {
        flex-shrink: 0;
        min-width: 120px;
    }

    .chart-section {
        border-radius: 12px;
    }

    .chart-header {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .pair-selector {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .pair-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .chart-controls {
        width: 100%;
        justify-content: space-between;
    }

    .timeframe-selector {
        gap: 4px;
    }

    .tf-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .chart-wrapper {
        height: 400px;
        min-height: 300px;
    }

    .drawing-toolbar {
        flex-wrap: wrap;
        padding: 8px;
        gap: 8px;
    }

    .toolbar-section {
        gap: 6px;
    }

    .drawing-tool-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .drawing-tool-btn span {
        display: none;
    }

    .drawing-tool-btn i {
        margin: 0;
        font-size: 1rem;
    }

    .trading-panel {
        padding: 16px;
        border-radius: 12px;
    }

    .panel-header h3 {
        font-size: 1rem;
    }

    .trade-type-selector {
        gap: 8px;
    }

    .trade-type-btn {
        padding: 12px;
        font-size: 0.9rem;
    }

    .positions-sidebar {
        max-height: 300px;
    }

    .positions-header {
        padding: 12px;
    }

    .positions-header h3 {
        font-size: 0.95rem;
    }

    .position-card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .position-card-header {
        font-size: 0.9rem;
    }

    .position-card-body {
        font-size: 0.8rem;
    }

    .table-header, .position-row {
        grid-template-columns: repeat(3, 1fr);
        font-size: 0.8rem;
    }

    .table-header span:nth-child(n+4),
    .position-row span:nth-child(n+4) {
        display: none;
    }

    .pair-selector {
        flex-wrap: wrap;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .history-stats {
        grid-template-columns: 1fr;
    }

    .duration-selector {
        justify-content: center;
    }
}

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

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

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

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

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

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

.wallet-buttons {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    width: 100%;
    animation: slideDown 0.3s ease;
}

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

.wallet-action-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wallet-action-btn.deposit {
    background: var(--gradient-green);
    color: white;
}

.wallet-action-btn.withdraw {
    background: var(--gradient-red);
    color: white;
}

.wallet-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Payment Methods Grid */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.payment-method-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 140px;
}

.payment-method-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.method-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.method-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.back-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

/* ============================================
   Withdraw Modal
   ============================================ */

.withdraw-modal {
    max-width: 500px;
}

.withdraw-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.withdraw-method-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 140px;
    text-align: center;
}

.withdraw-method-btn:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.withdraw-method-btn.selected {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.withdraw-method-btn i {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.withdraw-method-btn span {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.method-btn {
    padding: 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.method-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.05);
}

.method-btn.active {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.1);
}

.method-btn i {
    font-size: 2rem;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.method-btn .method-name {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.submit-withdraw {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--gradient-green);
    color: white;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.submit-withdraw:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.submit-withdraw-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--gradient-green);
    color: white;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-withdraw-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.submit-withdraw-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.step-title {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.available-balance {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.available-balance span:first-child {
    color: var(--text-secondary);
    font-weight: 600;
}

.available-balance span:last-child {
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 1.1rem;
}

.amount-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
}

.amount-info span {
    color: var(--text-muted);
}

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-input-wrapper input {
    padding-right: 50px !important;
}

.amount-input-wrapper .currency-label {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

/* ============================================
   Chat Widget - Enhanced Support System
   ============================================ */

/* Chat Widget Button */
.chat-widget-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6), 0 0 0 8px rgba(102, 126, 234, 0.1);
    }
}

.chat-widget-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.chat-widget-btn.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    animation: none;
}

.chat-widget-btn.has-notification {
    animation: chatShake 0.5s ease-in-out;
}

@keyframes chatShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

.chat-widget-btn .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border: 3px solid var(--bg-primary);
    animation: badgePulse 1s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    left: 24px;
    width: 380px;
    height: 580px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 999;
    overflow: hidden;
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chat-window .chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.admin-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.admin-info {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-weight: 700;
    color: white;
    font-size: 1rem;
}

.admin-status {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d26a;
    animation: statusDotPulse 2s infinite;
}

@keyframes statusDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Messages Area */
.chat-window .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-primary);
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.chat-welcome i {
    font-size: 3rem;
    color: var(--accent-blue);
    margin-bottom: 12px;
    display: block;
}

.chat-welcome p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-welcome small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    animation: messageSlideIn 0.3s ease;
    word-wrap: break-word;
}

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

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.admin {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-message .message-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-message .message-content img {
    max-width: 200px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chat-message .message-content img:hover {
    transform: scale(1.05);
}

.chat-message .message-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 6px;
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-blue);
}

.chat-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    outline: none;
}

.chat-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.attach-btn:hover {
    background: var(--accent-blue);
    color: white;
    transform: scale(1.1);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.chat-send-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Image Viewer */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-viewer-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
}

.close-viewer {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    color: #333;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-viewer:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--accent-red);
    color: white;
}

/* Old Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999;
}

/* ============================================
   Chart Drawing Toolbar
   ============================================ */

.drawing-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.toolbar-section {
    display: flex;
    gap: 4px;
    padding: 0 4px;
}

.toolbar-section:not(:last-child) {
    border-left: 1px solid var(--border-color);
    padding-left: 8px;
}

.drawing-tool-btn {
    min-width: 42px;
    height: 42px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: 'Cairo', sans-serif;
    padding: 4px 8px;
}

.drawing-tool-btn i {
    font-size: 1.1rem;
}

.drawing-tool-btn span {
    font-size: 0.7rem;
    white-space: nowrap;
}

.drawing-tool-btn:hover {
    background: var(--bg-primary);
    color: var(--accent-blue);
    transform: translateY(-2px);
}

.drawing-tool-btn.active {
    background: var(--accent-blue);
    color: white;
}

.drawing-tool-btn.clear-btn:hover {
    color: var(--text-primary);
}

.drawing-tool-btn.delete-btn:hover {
    background: var(--accent-red);
    color: white;
}

/* Drawing Cursor States */
canvas.drawing-mode {
    cursor: crosshair;
}

/* Responsive Drawing Toolbar */
@media (max-width: 768px) {
    .drawing-toolbar {
        top: auto;
        bottom: 10px;
        left: 10px;
        flex-wrap: wrap;
        max-width: calc(100% - 100px);
    }

    .drawing-tool-btn {
        min-width: 36px;
        height: 36px;
    }

    .drawing-tool-btn span {
        display: none;
    }
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-blue);
    background: linear-gradient(135deg, var(--accent-blue) 0%, #4a8fe7 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle .unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-red);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

.chat-box {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 380px;
    height: 550px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-box.active {
    display: flex;
    animation: chatSlideUp 0.3s ease;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header h3 i {
    color: var(--accent-blue);
}

.chat-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-close:hover {
    background: var(--accent-red);
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: messageSlide 0.2s ease;
}

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

.message.user {
    align-self: flex-end;
    background: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.admin {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

.message img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}

.chat-input {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input textarea {
    flex: 1;
    min-height: 40px;
    max-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    resize: none;
}

.chat-input textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.chat-input-actions {
    display: flex;
    gap: 4px;
}

.chat-input-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.chat-input-btn.send {
    background: var(--accent-blue);
    color: white;
}

.chat-input-btn.send:hover {
    background: #4a8fe7;
}

.chat-input-btn.send:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ============================================
   Account Switcher Modal
   ============================================ */

.account-switcher-content {
    max-width: 700px;
}

.account-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.account-option {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.account-option:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.account-option.demo .account-icon {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
}

.account-option.real .account-icon {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-gold);
}

.account-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.account-details h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.account-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.account-balance {
    background: rgba(88, 166, 255, 0.05);
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.account-balance span {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
}

.account-switch-btn {
    width: 100%;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.account-switch-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.account-switch-btn.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.demo-add-balance {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--gradient-blue);
    background: linear-gradient(135deg, var(--accent-blue) 0%, #4a8fe7 100%);
    color: white;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.demo-add-balance:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .account-options {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Mobile Phones (Portrait)
   ============================================ */

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .header {
        padding: 10px;
        gap: 10px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .header-right, .header-left {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .balance-card {
        flex-direction: column;
        padding: 10px;
    }

    .balance-divider {
        width: 100%;
        height: 1px;
    }

    .balance-amount {
        font-size: 0.95rem;
    }

    .main-content {
        padding: 8px;
    }

    .market-info-bar {
        gap: 10px;
        padding: 6px 8px;
    }

    .market-item {
        min-width: 100px;
        font-size: 0.75rem;
    }

    .chart-wrapper {
        height: 300px;
        min-height: 250px;
    }

    .price-info {
        font-size: 0.9rem;
        padding: 6px;
    }

    .candle-timer {
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    .trading-panel {
        padding: 12px;
    }

    .trade-type-btn {
        padding: 10px;
        font-size: 0.85rem;
    }

    .lot-input-wrapper input {
        font-size: 1rem;
        padding: 10px;
    }

    .duration-selector {
        gap: 6px;
    }

    .duration-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .execute-btn {
        padding: 14px;
        font-size: 0.95rem;
    }

    .positions-header {
        padding: 10px;
    }

    .position-card {
        padding: 10px;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 15px;
    }

    .user-dropdown {
        right: 10px;
        min-width: 200px;
    }

    .wallet-buttons {
        flex-direction: column;
        right: 10px;
        gap: 6px;
    }

    .wallet-action-btn {
        width: 100%;
        padding: 10px;
    }
}

/* ============================================
   Touch Device Enhancements
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    button, .btn, .pair-btn, .tf-btn, .duration-btn, .trade-type-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .drawing-tool-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger font sizes for readability */
    body {
        font-size: 16px;
    }

    /* Remove hover effects that don't work on touch */
    * {
        -webkit-tap-highlight-color: rgba(88, 166, 255, 0.1);
    }

    /* Better scrolling */
    .positions-list,
    .market-info-bar {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

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

.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-links a i {
    font-size: 0.9rem;
}

.footer-copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-copyright p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 768px) {
    .footer-links {
        gap: 20px;
        flex-direction: column;
        align-items: center;
    }

    .footer-copyright {
        font-size: 0.85rem;
    }
}

/* ============================================
   Records Page
   ============================================ */

.records-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 250px);
}

.records-sidebar {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    width: 250px;
    min-width: 250px;
    height: fit-content;
    position: sticky;
    top: 90px;
    flex-shrink: 0;
}

.records-sidebar h3 {
    color: var(--text-primary);
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.records-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.records-menu-btn {
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
}

.records-menu-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
}

.records-menu-btn.active {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.records-menu-btn i {
    font-size: 1.2rem;
}

.records-content {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    min-width: 0;
}

.records-tab {
    display: none;
}

.records-tab.active {
    display: block;
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.records-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.records-filters {
    display: flex;
    gap: 10px;
}

.records-filters select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.records-filters select:hover {
    border-color: var(--accent-blue);
}

.records-filters select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.records-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon.deposit {
    background: linear-gradient(135deg, #00d26a 0%, #00a650 100%);
    color: white;
}

.stat-icon.withdraw {
    background: linear-gradient(135deg, #ff4757 0%, #e4002b 100%);
    color: white;
}

.stat-icon.pending {
    background: linear-gradient(135deg, #ffd700 0%, #f0b90b 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, #00d26a 0%, #00a650 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, #ff4757 0%, #e4002b 100%);
    color: white;
}

.stat-icon.info {
    background: linear-gradient(135deg, #58a6ff 0%, #1a5fb4 100%);
    color: white;
}

.stat-icon.profit {
    background: linear-gradient(135deg, #f0b90b 0%, #ffd700 100%);
    color: white;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stat-value {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
}

.records-table-container {
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table thead {
    background: var(--bg-primary);
}

.records-table th {
    padding: 15px;
    text-align: right;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.records-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.records-table tbody tr:hover {
    background: var(--bg-primary);
}

.records-table tbody tr:last-child {
    border-bottom: none;
}

.records-table td {
    padding: 15px;
    text-align: right;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.operation-number {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 1rem;
}

.transaction-type {
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.transaction-type.deposit {
    background: rgba(0, 210, 106, 0.15);
    color: var(--accent-green);
}

.transaction-type.withdraw {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

.status-badge.pending {
    background: rgba(240, 185, 11, 0.15);
    color: #f0b90b;
}

.status-badge.in_progress {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-blue);
}

.status-badge.completed {
    background: rgba(0, 210, 106, 0.15);
    color: var(--accent-green);
}

.status-badge.cancelled {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
}

.trade-direction {
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.trade-direction.buy {
    background: rgba(0, 210, 106, 0.15);
    color: var(--accent-green);
}

.trade-direction.sell {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
}

.trade-result {
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.trade-result.win {
    background: rgba(0, 210, 106, 0.15);
    color: var(--accent-green);
}

.trade-result.loss {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
}

.empty-state {
    text-align: center;
    padding: 60px 20px !important;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: block;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

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

@media (max-width: 1024px) {
    .records-container {
        flex-direction: column;
    }

    .records-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }

    .records-menu {
        flex-direction: row;
    }

    .records-menu-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .records-container {
        padding: 10px;
    }

    .records-content {
        padding: 15px;
    }

    .records-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .records-filters {
        width: 100%;
        flex-direction: column;
    }

    .records-filters select {
        width: 100%;
    }

    .records-stats {
        grid-template-columns: 1fr;
    }

    .records-table-container {
        overflow-x: auto;
    }

    .records-table {
        min-width: 600px;
    }

    .records-menu {
        flex-direction: column;
    }
}
