@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #0B0E11;
    --surface-color: #1E2329;
    --primary-color: #FCD535;
    --primary-hover: #F0B90B;
    --text-primary: #EAECEF;
    --text-secondary: #848E9C;
    --border-color: #2B3139;
    --success-color: #0ECB81;
    --danger-color: #F6465D;
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --header-height: 64px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header & Navigation */
header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

nav a:hover,
nav a.active {
    color: var(--text-primary);
}

nav a.active {
    position: relative;
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

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

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.page-description {
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #2B3139;
}

/* Form Elements */
.input-group {
    display: flex;
    gap: 0.5rem;
}

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

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

input,
select {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: var(--surface-color);
    color: var(--text-primary);
}

select option {
    background: var(--surface-color);
    color: var(--text-primary);
}

::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 214, 0, 0.1);
}

/* Buttons & Controls */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-family: inherit;
}

.radio-group {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 8px;
    width: fit-content;
}

.radio-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    user-select: none;
    line-height: 1;
}

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

.radio-btn.active {
    background: var(--primary-color);
    color: #000;
    font-weight: 600;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(14, 203, 129, 0.15);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(246, 70, 93, 0.15);
    color: var(--danger-color);
}

.badge-secondary {
    background: rgba(132, 142, 156, 0.15);
    color: var(--text-secondary);
}

.badge-long {
    background: rgba(14, 203, 129, 0.2) !important;
    color: #0ECB81 !important;
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.badge-short {
    background: rgba(246, 70, 93, 0.2) !important;
    color: #F6465D !important;
    border: 1px solid rgba(246, 70, 93, 0.3);
}

/* Utilities */
.text-end {
    text-align: right;
}

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

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.mt-1 {
    margin-top: 0.25rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.d-none {
    display: none !important;
}

.h-full {
    height: 100%;
}

.flex-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

.flex-1 {
    flex: 1;
}

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

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

@media (max-width: 900px) {
    .backtest-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0 1rem;
        flex-direction: column;
        height: auto;
        padding-bottom: 1rem;
    }

    .brand {
        height: 64px;
    }

    nav ul {
        gap: 0.75rem;
    }
}