:root {
    --primary: #00e5ff;
    --primary-gradient: linear-gradient(90deg, #00e5ff, #0077ff);
    --dark: #0d111a;
    --grey: #181c25;
    --light: #ffffff;
    --green: #00d67d;
    --red: #ff3b6b;
    --text: #e0e3ff; /* Brighter text color */
    --text-muted: #a0a6cc; /* Less muted for better visibility */
    --font: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --radius: 12px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font);
}

body {
    background: radial-gradient(circle at top left, #0f1320, #0a0c12 80%);
    color: var(--text); /* Changed from var(--light) to var(--text) */
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ensure main content is not hidden behind fixed navbar */
.container.mt-4 {
    margin-top: 120px !important; /* Adjust if navbar height changes */
}

/* HEADER/NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 17, 22, 0.95); /* Slightly more opaque */
    backdrop-filter: blur(12px);
    padding: 14px 36px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 22px;
    color: var(--primary);
    letter-spacing: 0.5px;
    text-decoration: none;
}

.nav-link {
    color: var(--text) !important; /* Brighter color */
    text-decoration: none;
    position: relative;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    margin: 0 5px;
}

.nav-link:hover {
    color: var(--primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* BUTTONS */
.btn {
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    color: var(--dark); /* Ensure button text is readable */
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--dark);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.15);
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.6);
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-secondary:hover {
    background: var(--primary-gradient);
    color: var(--dark);
    border-color: transparent;
}

/* CARDS */
.card {
    background: rgba(24, 27, 36, 0.85); /* Less transparent for better contrast */
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    transition: all 0.3s ease;
    color: var(--text); /* Use brighter text */
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 229, 255, 0.2);
}

.card-header {
    background: rgba(15, 17, 22, 0.9); /* Less transparent */
    color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-body {
    padding: 28px;
}

/* STAT CARDS */
.stat-card {
    background: rgba(24, 27, 36, 0.85);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    color: var(--text);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.95rem; /* Slightly larger */
    color: var(--text-muted);
    font-weight: 500;
}

.positive {
    color: var(--green) !important;
}

.negative {
    color: var(--red) !important;
}

/* METRIC CARDS */
.metric-card {
    background: rgba(24, 27, 36, 0.85);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    height: 100%;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
}

.metric-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-label {
    font-size: 0.95rem; /* Slightly larger */
    color: var(--text-muted);
    font-weight: 500;
}

/* CHARTS */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background: rgba(24, 27, 36, 0.85);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* FORMS */
.form-control, .form-select {
    background: rgba(24, 27, 36, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    padding: 12px 15px;
    color: var(--text);
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.form-control:focus, .form-select:focus {
    background: rgba(24, 27, 36, 1);
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 0 0.2rem rgba(0, 229, 255, 0.25);
}

/* Make small helper/helper-text labels (e.g., risk per trade hint) brighter for readability */
.form-text {
    color: var(--text) !important;
}

/* TABLES */
.table {
    background: rgba(24, 27, 36, 0.85);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.table th {
    background: rgba(15, 17, 22, 0.9);
    color: var(--primary);
    font-weight: 600;
    border: none;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table td {
    padding: 12px 15px;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    /* Slight contrast for odd rows but keep text readable */
    background-color: rgba(255, 255, 255, 0.03);
}

.table-striped tbody tr:nth-of-type(even) {
    /* Provide a subtle but visible background for even rows too */
    background-color: rgba(255, 255, 255, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 229, 255, 0.1);
}

/* STRATEGY CODE */
.strategy-code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem; /* Slightly larger */
    border-radius: var(--radius);
    background: rgba(15, 17, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* PROGRESS BARS */
.progress {
    height: 10px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    border-radius: 10px;
    background: var(--primary-gradient);
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* FOOTER */
footer {
    background: rgba(15, 17, 22, 0.95);
    color: var(--text-muted);
    padding: 50px 0 24px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* PAGE HEADER */
.page-header {
    background: rgba(24, 27, 36, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* RESULTS SUMMARY */
.results-summary {
    background: rgba(24, 27, 36, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* SECTION TITLE */
.section-title {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
    position: relative;
    padding-bottom: 10px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
}

/* BADGES & TOOLTIPS */
.badge-indicator {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--primary-gradient);
    color: var(--dark);
}

.tooltip-icon {
    color: var(--primary);
    margin-left: 5px;
    cursor: pointer;
}

/* MODALS */
.modal-content {
    background: rgba(24, 27, 36, 0.98); /* Almost opaque */
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.modal-header {
    background: rgba(15, 17, 22, 0.95);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--primary);
}

.modal-body {
    padding: 28px;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 229, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

/* LOADING STATES */
.loading {
    display: none;
}

/* DROPDOWNS */
.dropdown-menu {
    background: rgba(24, 27, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
}

.dropdown-item {
    color: var(--text);
    padding: 10px 15px;
}

.dropdown-item:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
}

/* Strategy Tips: remove default white background from list items */
.list-group.list-group-flush .list-group-item {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.list-group.list-group-flush .list-group-item:last-child {
    border-bottom: none;
}

/* TOOLTIPS */
.tooltip {
    --bs-tooltip-bg: rgba(24, 27, 36, 0.95);
    --bs-tooltip-color: var(--text);
}

/* TEXT SELECTION */
::selection {
    background: rgba(0, 229, 255, 0.3);
    color: var(--text);
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 17, 22, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.5);
}

/* RESPONSIVE */
@media (max-width: 800px) {
    .navbar {
        padding: 14px 20px;
    }
    
    .stat-value, .metric-value {
        font-size: 1.6rem;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .chart-container {
        height: 300px;
        padding: 15px;
    }
    
    .table th,
    .table td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}