/* QGTRADER - Professional Trading Platform CSS */
:root {
    /* Light Theme Colors */
    --bg-primary-light: #ffffff;
    --bg-secondary-light: #f8f9fa;
    --bg-tertiary-light: #e9ecef;
    --text-primary-light: #212529;
    --text-secondary-light: #6c757d;
    --border-light: #dee2e6;
    --shadow-light: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);

    /* Dark Theme Colors */
    --bg-primary-dark: #1a1d21;
    --bg-secondary-dark: #252831;
    --bg-tertiary-dark: #2d3139;
    --text-primary-dark: #ffffff;
    --text-secondary-dark: #adb5bd;
    --border-dark: #495057;
    --shadow-dark: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);

    /* Trading Colors */
    --color-bull: #00d4aa;
    --color-bear: #ff6b6b;
    --color-warning: #ffc107;
    --color-info: #17a2b8;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    --gradient-success: linear-gradient(135deg, #00d4aa 0%, #00a085 100%);
    --gradient-danger: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* Light Theme (Default) */
body[data-theme="light"] {
    background-color: var(--bg-secondary-light);
    color: var(--text-primary-light);
}

/* Dark Theme */
body[data-theme="dark"] {
    background-color: var(--bg-primary-dark);
    color: var(--text-primary-dark);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header/Navbar */
.navbar {
    background: var(--gradient-primary);
    padding: 1rem 0;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.balance-display {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
}

.login-card {
    background: var(--bg-primary-light);
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
}

body[data-theme="dark"] .login-card {
    background: var(--bg-secondary-dark);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary-light);
    font-size: 0.9rem;
}

body[data-theme="dark"] .login-header p {
    color: var(--text-secondary-dark);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary-light);
}

body[data-theme="dark"] .form-label {
    color: var(--text-primary-dark);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary-light);
    color: var(--text-primary-light);
}

body[data-theme="dark"] .form-control {
    background: var(--bg-tertiary-dark);
    border-color: var(--border-dark);
    color: var(--text-primary-dark);
}

.form-control:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-light);
    color: var(--text-primary-light);
}

body[data-theme="dark"] .btn-outline {
    border-color: var(--border-dark);
    color: var(--text-primary-dark);
}

/* Trading Interface */
.trading-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.chart-container {
    background: var(--bg-primary-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    min-height: 600px;
}

body[data-theme="dark"] .chart-container {
    background: var(--bg-secondary-dark);
    box-shadow: var(--shadow-dark);
}

.trading-panel {
    background: var(--bg-primary-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    height: fit-content;
}

body[data-theme="dark"] .trading-panel {
    background: var(--bg-secondary-dark);
    box-shadow: var(--shadow-dark);
}

/* Trading Controls */
.asset-selector {
    margin-bottom: 1.5rem;
}

.asset-price {
    text-align: center;
    margin-bottom: 1.5rem;
}

.current-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-bull);
}

.price-change {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.price-change.positive {
    color: var(--color-bull);
}

.price-change.negative {
    color: var(--color-bear);
}

.trade-controls {
    margin-bottom: 1.5rem;
}

.amount-input {
    margin-bottom: 1rem;
}

.time-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.time-btn {
    padding: 0.5rem;
    border: 2px solid var(--border-light);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

body[data-theme="dark"] .time-btn {
    border-color: var(--border-dark);
    color: var(--text-primary-dark);
}

.time-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

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

.trade-btn {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-btn.call {
    background: var(--gradient-success);
    color: white;
}

.trade-btn.put {
    background: var(--gradient-danger);
    color: white;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    text-align: center;
}

body[data-theme="dark"] .stat-card {
    background: var(--bg-secondary-dark);
    box-shadow: var(--shadow-dark);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body[data-theme="dark"] .stat-label {
    color: var(--text-secondary-dark);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    font-weight: 500;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--color-warning);
    color: #856404;
}

.alert-success {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--color-bull);
    color: #155724;
}

.alert-danger {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--color-bear);
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .trading-layout {
        grid-template-columns: 1fr;
    }

    .trading-panel {
        order: -1;
    }
}

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

    .login-card {
        margin: 20px;
        padding: 2rem;
    }

    .navbar-nav {
        gap: 1rem;
    }

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

    .trade-buttons {
        grid-template-columns: 1fr;
    }

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

/* Loading States */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.fw-bold { font-weight: 700; }
.fw-medium { font-weight: 500; }

.text-bull { color: var(--color-bull); }
.text-bear { color: var(--color-bear); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--text-secondary-light); }

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

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}