/* Polymarket Bot - Main Stylesheet */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: #334155;
    --border-light: #475569;

    --positive: #22c55e;
    --negative: #ef4444;
    --neutral: #94a3b8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container {
    position: relative;
    width: 48px;
    height: 48px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    border-radius: 12px;
    color: white;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    animation: logo-pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes logo-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}

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

.brand-text {
    font-weight: 700;
    font-size: 1.35rem;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.logo, .logo-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: white;
    font-weight: bold;
    border-radius: 8px;
}

.logo {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.logo-large {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.nav-link svg {
    opacity: 0.7;
}

.nav-link.active svg {
    opacity: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Uptime Display */
.uptime-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    margin-right: 0.75rem;
}

.uptime-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.uptime-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #22c55e;
    border-radius: 50%;
    animation: uptime-pulse 2s ease-in-out infinite;
    opacity: 0;
}

@keyframes uptime-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0;
    }
    50% {
        transform: scale(1.8);
        opacity: 0.3;
    }
}

.uptime-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.uptime-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #22c55e;
    letter-spacing: 0.5px;
}

.uptime-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.mode-badge-wrapper {
    position: relative;
}

.mode-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.mode-badge .mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.mode-badge.demo {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.mode-badge.demo .mode-dot {
    background: #3b82f6;
    box-shadow: 0 0 10px #3b82f6;
}

.mode-badge.live {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(249, 115, 22, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.mode-badge.live .mode-dot {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem 0.4rem 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    cursor: pointer;
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.user-info {
    color: var(--text-secondary);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #1e2028 0%, #16181d 100%);
    border: 1px solid #2d3139;
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #d1d5db;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #fff;
}

.dropdown-item svg {
    opacity: 0.7;
}

.dropdown-item:hover svg {
    opacity: 1;
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-logout:hover {
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

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

.btn-success:hover:not(:disabled) {
    background-color: #16a34a;
}

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

.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--border-light);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Panels */
.panel {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-body {
    padding: 1.25rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

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

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-footer {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-footer .warning {
    color: var(--warning);
}

/* Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

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

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-value.positive {
    color: var(--positive);
}

.stat-value.negative {
    color: var(--negative);
}

.stat-value.mode-demo {
    color: var(--info);
}

.stat-value.mode-live {
    color: var(--danger);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Market Panel */
.market-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.market-row .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.market-row .value {
    font-weight: 500;
}

.time-display {
    font-family: monospace;
    font-size: 1.25rem;
    color: var(--warning);
}

.asset-select {
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Signal Panel */
.signal-display {
    text-align: center;
}

.signal-indicator {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: var(--bg-input);
}

.signal-indicator.buy-up {
    background-color: rgba(34, 197, 94, 0.2);
    border: 2px solid var(--positive);
}

.signal-indicator.buy-down {
    background-color: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--negative);
}

.signal-text {
    font-size: 1.25rem;
    font-weight: bold;
}

.signal-indicator.buy-up .signal-text {
    color: var(--positive);
}

.signal-indicator.buy-down .signal-text {
    color: var(--negative);
}

.signal-details {
    text-align: left;
}

.candle-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

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

.candle-value {
    font-weight: 500;
}

.candle-value.bullish {
    color: var(--positive);
}

.candle-value.bearish {
    color: var(--negative);
}

.candle-match::after {
    margin-left: 0.5rem;
}

.candle-match.match::after {
    content: "check";
    color: var(--positive);
}

.candle-match.no-match::after {
    content: "x";
    color: var(--negative);
}

/* Cycle Panel */
.cycle-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.level-display {
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.level-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
}

.level-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
}

.level-max {
    font-size: 1rem;
    color: var(--text-muted);
}

.cycle-row {
    display: flex;
    justify-content: space-between;
}

.cycle-row .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.cycle-row .value {
    font-weight: 500;
}

.cycle-row.highlight {
    padding: 0.75rem;
    background-color: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    margin-top: 0.5rem;
}

/* Exposure Panel */
.exposure-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exposure-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.exposure-row .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.exposure-row .value {
    font-weight: 500;
}

.exposure-row .value.positive {
    color: var(--positive);
}

.exposure-row .value.negative {
    color: var(--negative);
}

.exposure-row.highlight {
    padding: 0.75rem;
    background-color: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    margin-top: 0.5rem;
    border-bottom: none;
}

/* Bot Readiness Panel */
.readiness-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.readiness-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.readiness-item:last-child {
    border-bottom: none;
}

.readiness-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
    flex-shrink: 0;
}

.readiness-item.connected .readiness-indicator {
    background-color: var(--positive);
    box-shadow: 0 0 8px var(--positive);
}

.readiness-item.disconnected .readiness-indicator {
    background-color: var(--negative);
    box-shadow: 0 0 8px var(--negative);
}

.readiness-item.checking .readiness-indicator {
    background-color: var(--warning);
    animation: pulse 1s infinite;
}

.readiness-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.readiness-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.readiness-item.connected .readiness-status {
    color: var(--positive);
}

.readiness-item.disconnected .readiness-status {
    color: var(--negative);
}

.readiness-summary {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    background-color: var(--bg-input);
}

.readiness-summary.all-ready {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.readiness-summary.all-ready .summary-text {
    color: var(--positive);
    font-weight: 600;
}

.readiness-summary.has-issues {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.readiness-summary.has-issues .summary-text {
    color: var(--negative);
    font-weight: 600;
}

/* Position Panel */
.no-position {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.position-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.position-direction {
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
}

.position-direction.UP {
    background-color: rgba(34, 197, 94, 0.2);
    color: var(--positive);
}

.position-direction.DOWN {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--negative);
}

.position-row {
    display: flex;
    justify-content: space-between;
}

.position-row .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.position-row .value {
    font-weight: 500;
}

.position-row.sl .value {
    color: var(--negative);
}

.position-row.tp .value {
    color: var(--positive);
}

/* Controls Panel */
.bot-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.stopped {
    background-color: var(--text-muted);
}

.status-indicator.running {
    background-color: var(--positive);
    animation: pulse 2s infinite;
}

.status-indicator.paused {
    background-color: var(--warning);
}

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

.status-text {
    font-weight: 600;
    text-transform: uppercase;
}

.control-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.demo-controls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Stats Panel */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-input);
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Log Panel */
.log-panel {
    grid-column: 1 / -1;
}

.log-container {
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.875rem;
}

.log-entry {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.log-entry.info {
    color: var(--info);
}

.log-entry.success {
    color: var(--positive);
}

.log-entry.warning {
    color: var(--warning);
}

.log-entry.error {
    color: var(--negative);
}

/* Closed Trades Panel */
.trades-panel {
    grid-column: 1 / -1;
}

.trades-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Trades Tabs */
.trades-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s ease;
}

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

.tab-btn.active {
    color: var(--accent);
    background: var(--bg-input);
    border-bottom: 2px solid var(--accent);
}

.tab-content {
    display: none;
}

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

.trades-table-container {
    max-height: 500px;
    overflow-y: auto;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.trades-table th {
    position: sticky;
    top: 0;
    background-color: var(--bg-input);
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.trades-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.trades-table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.trades-table .no-trades td {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.trades-table .direction-up {
    color: var(--positive);
    font-weight: 600;
}

.trades-table .direction-down {
    color: var(--negative);
    font-weight: 600;
}

.trades-table .exit-tp {
    color: var(--positive);
    font-weight: 500;
}

.trades-table .exit-sl {
    color: var(--negative);
    font-weight: 500;
}

.trades-table .exit-force {
    color: var(--warning);
    font-weight: 500;
}

.trades-table .pnl-positive {
    color: var(--positive);
    font-weight: 600;
}

.trades-table .pnl-negative {
    color: var(--negative);
    font-weight: 600;
}

.trades-table .trade-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: monospace;
}

/* Settings Page */
.settings-page h1 {
    margin-bottom: 1.5rem;
}

.mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.mode-option {
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-option.active {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.mode-option input {
    display: none;
}

.mode-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.mode-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

.setting-item {
    padding: 1rem;
    background-color: var(--bg-input);
    border-radius: 8px;
}

.setting-item label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.setting-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.setting-item.highlight {
    background-color: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
}

.settings-note {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.settings-note.warning {
    color: var(--warning);
}

/* Capital Requirements */
.capital-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.capital-item {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--bg-input);
    border-radius: 8px;
}

.capital-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.capital-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.capital-item.highlight {
    background-color: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
}

/* Level Table */
.table-responsive {
    overflow-x: auto;
}

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

.level-table th,
.level-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.level-table th {
    background-color: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.level-table td:first-child,
.level-table th:first-child {
    text-align: left;
}

.level-cell {
    font-weight: 600;
    color: var(--primary);
}

.loss-cell {
    color: var(--negative);
}

.positive {
    color: var(--positive);
}

.negative {
    color: var(--negative);
}

.table-legend {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-input);
    border-radius: 8px;
    font-size: 0.875rem;
}

.table-legend p {
    margin-bottom: 0.5rem;
}

.table-legend p:last-child {
    margin-bottom: 0;
}

/* Rules Box */
.rules-box {
    padding: 1.5rem;
    background-color: var(--bg-input);
    border-radius: 8px;
}

.rules-box h3 {
    margin-bottom: 1rem;
}

.rules-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.rules-list li {
    margin-bottom: 0.75rem;
}

.rule-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.signal-examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.signal-example {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.signal-example.valid {
    background-color: rgba(34, 197, 94, 0.1);
}

.signal-example.invalid {
    background-color: rgba(148, 163, 184, 0.1);
}

.signal-icon {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.signal-condition {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Boundaries Grid */
.boundaries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.boundary-item {
    padding: 1rem;
    background-color: var(--bg-input);
    border-radius: 8px;
    text-align: center;
}

.boundary-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.boundary-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Error Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.error-container {
    text-align: center;
}

.error-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    font-size: 3rem;
    font-weight: bold;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-calc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.footer-calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.footer-calc-btn svg {
    stroke: currentColor;
}

/* Utility */
.hidden {
    display: none !important;
}

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

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

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

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

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Responsive - Tablet */
@media (max-width: 1024px) {
    .navbar {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        padding: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .nav-right {
        gap: 0.75rem;
    }

    .uptime-display {
        margin-right: 0.5rem;
    }

    .mode-toggle-wrapper {
        padding: 4px 8px;
    }

    .user-name {
        display: none;
    }
}

/* Mobile Responsive - Phone */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .navbar {
        padding: 0.5rem 1rem;
        position: relative;
    }

    .nav-brand {
        gap: 0.75rem;
    }

    .logo-container {
        width: 40px;
        height: 40px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-icon svg {
        width: 22px;
        height: 22px;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .brand-tagline {
        font-size: 0.6rem;
        display: none;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem;
        flex-direction: column;
        width: 100%;
        z-index: 1000;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }

    .nav-right {
        gap: 0.5rem;
        margin-left: auto;
    }

    .uptime-display {
        display: none;
    }

    .mode-toggle-wrapper {
        padding: 4px 8px;
        gap: 4px;
    }

    .mode-label {
        font-size: 9px;
    }

    .mode-toggle-switch {
        width: 36px;
        height: 18px;
    }

    .mode-toggle-slider:before {
        height: 12px;
        width: 12px;
    }

    .mode-toggle-switch input:checked + .mode-toggle-slider:before {
        transform: translateX(18px);
    }

    .user-menu {
        padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .user-name {
        display: none;
    }

    .user-dropdown {
        right: -10px;
    }
}

/* Mobile Responsive - Small Phone */
@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem;
    }

    .nav-brand {
        gap: 0.5rem;
    }

    .logo-container {
        width: 36px;
        height: 36px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .logo-icon svg {
        width: 20px;
        height: 20px;
    }

    .brand-text {
        font-size: 1rem;
    }

    .brand-tagline {
        display: none;
    }

    .mode-toggle-wrapper {
        padding: 3px 6px;
    }

    .mode-label {
        font-size: 8px;
    }

    .mobile-menu-btn {
        width: 36px;
        height: 36px;
    }

    .container {
        padding: 0.75rem;
    }

    .panel-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .panel-body {
        padding: 1rem;
    }
}

/* Restart Countdown Timer Styles */
.restart-countdown {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #e94560;
    border-radius: 12px;
    text-align: center;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: #e94560;
        box-shadow: 0 0 5px rgba(233, 69, 96, 0.3);
    }
    50% {
        border-color: #ff6b6b;
        box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    }
}

.restart-countdown.hidden {
    display: none;
}

.countdown-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.countdown-icon {
    font-size: 1.5rem;
}

.countdown-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e94560;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-reason {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.countdown-timer {
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    letter-spacing: 3px;
    margin: 0.5rem 0;
}

.countdown-note {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Responsive adjustments for countdown */
@media (max-width: 768px) {
    .countdown-timer {
        font-size: 2rem;
    }
    
    .countdown-title {
        font-size: 0.8rem;
    }
}
