:root {
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    
    --red-500: #ef4444;
    --red-50: #fef2f2;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
}

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 22px;
    color: var(--gray-900);
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--orange-500);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.voltfi-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    object-fit: contain;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-weight: 500;
    font-size: 15px;
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--gray-900);
}

.nav-link.active {
    color: var(--orange-500);
}

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

.price-display {
    text-align: right;
}

.price-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.price-change {
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
}

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

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

.connect-wallet-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-900);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.connect-wallet-btn:hover {
    background: var(--gray-800);
}

.wallet-icon {
    width: 18px;
    height: 18px;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--gray-500);
}

.page-filters {
    display: flex;
    gap: 12px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--gray-300);
}

.filter-btn .icon {
    width: 20px;
    height: 20px;
}

.btc-icon {
    width: 20px;
    height: 20px;
    background: var(--orange-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* Protection Table */
.protection-table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.protection-table th {
    text-align: left;
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.protection-table td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

.protection-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.protection-table tbody tr:hover {
    background: var(--gray-50);
}

.protection-table tbody tr.selected {
    background: var(--orange-50);
    border-left: 3px solid var(--orange-500);
}

.range-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.radio-input {
    width: 20px;
    height: 20px;
    accent-color: var(--orange-500);
    cursor: pointer;
}

.range-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.fee-cell {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
}

.fee-unit {
    color: var(--gray-400);
    font-weight: 400;
    margin-left: 4px;
}

/* Win Condition Badges */
.win-condition-cell {
    min-width: 180px;
}

.win-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.trigger-badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.trigger-badge.below {
    background: var(--red-50);
    color: var(--red-500);
}

.trigger-badge.above {
    background: var(--green-50);
    color: var(--green-600);
}

.or-text {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
}

/* Protection Overview */
.protection-overview {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
}

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

.overview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.info-icon {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    cursor: help;
}

.selected-range-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.selected-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.selected-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--orange-500);
}

.active-badge {
    background: var(--green-50);
    color: var(--green-600);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.selected-range-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.selected-range-meta {
    font-size: 14px;
    color: var(--gray-500);
}

/* Amount Input */
.amount-section {
    margin-bottom: 24px;
}

.amount-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.amount-input-container {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.amount-input-container:focus-within {
    border-color: var(--orange-500);
}

.amount-input-icon {
    width: 28px;
    height: 28px;
    background: var(--orange-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    margin-right: 12px;
}

.amount-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    background: transparent;
}

.amount-input::placeholder {
    color: var(--gray-300);
}

.max-btn {
    background: none;
    border: none;
    color: var(--orange-500);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}

.max-btn:hover {
    color: var(--orange-600);
}

/* Fee Summary */
.fee-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-bottom: 24px;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fee-row:last-child {
    margin-bottom: 0;
}

.fee-label {
    font-size: 14px;
    color: var(--gray-500);
}

.fee-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.fee-value .unit {
    color: var(--gray-400);
    font-weight: 400;
    margin-left: 4px;
}

.fee-value.secondary {
    color: var(--gray-500);
    font-weight: 400;
}

.total-row {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
}

.total-row .fee-label {
    font-weight: 600;
    color: var(--gray-900);
}

.total-row .fee-value {
    color: var(--orange-500);
    font-size: 18px;
}

/* CTA Button */
.cta-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--orange-50) 0%, rgba(249, 115, 22, 0.1) 100%);
    border: 1px solid var(--orange-100);
    color: var(--orange-500);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cta-btn:hover {
    background: linear-gradient(135deg, var(--orange-100) 0%, rgba(249, 115, 22, 0.15) 100%);
    border-color: var(--orange-200);
}

.cta-btn .sparkle {
    font-size: 18px;
}

/* Layout Grid */
.protection-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .protection-layout {
        grid-template-columns: 1fr;
    }
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    z-index: 50;
    display: none;
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Chevron */
.chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.dropdown.open .chevron {
    transform: rotate(180deg);
}

/* Expiry Date Dropdown */
.expiry-date-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.expiry-date-dropdown .icon {
    width: 16px;
    height: 16px;
    color: var(--gray-500);
}

.expiry-date-dropdown select {
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    padding: 4px 8px;
    min-width: 200px;
}

.expiry-date-dropdown select:focus {
    outline: none;
}

.expiry-date-dropdown select option {
    background: white;
    color: var(--gray-700);
    padding: 8px;
}

/* Wallet Connected State */
.wallet-connected {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.wallet-dot {
    width: 8px;
    height: 8px;
    background: var(--green-500);
    border-radius: 50%;
}

/* Trigger Dropdown */
.trigger-cell {
    min-width: 140px;
}

.trigger-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}

.trigger-select:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.trigger-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

/* Trigger Badge Styles */
.trigger-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.trigger-badge.below {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-600);
}

.trigger-badge.above {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green-600);
}

.trigger-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

/* ============================================================
   DASHBOARD STYLES (matches protection page design)
   ============================================================ */

/* User Stats Badge in Header */
.user-stats-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
}

.user-stats-badge .stats-label {
    font-size: 12px;
    color: var(--gray-500);
}

.user-stats-badge .stats-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Dashboard Tab Navigation */
.dashboard-tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-primary);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: fit-content;
}

.dash-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.dash-tab:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.dash-tab.active {
    background: var(--orange-500);
    color: white;
}

/* Dashboard Tab Content */
.dashboard-tab-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 64px;
    color: var(--gray-500);
    font-size: 14px;
}

/* Rank Badge */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    background: var(--orange-50);
    color: var(--orange-600);
    font-weight: 600;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* Wallet Cell */
.wallet-cell {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 13px;
    color: var(--gray-600);
}

/* Points Value */
.points-value {
    font-weight: 600;
    color: var(--orange-500);
}

/* Trades Container */
.trades-container {
    padding: 0;
}

.trades-filter-row {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--gray-50);
}

.filter-pill {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-pill:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.filter-pill.active {
    background: var(--orange-500);
    border-color: var(--orange-500);
    color: white;
}

/* Status Pills for Trades */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill.active {
    background: var(--green-100);
    color: var(--green-600);
}

.status-pill.won {
    background: var(--green-100);
    color: var(--green-600);
}

.status-pill.lost {
    background: var(--red-50);
    color: var(--red-500);
}

/* Payout colors */
.payout-positive {
    color: var(--green-500);
    font-weight: 600;
}

.payout-negative {
    color: var(--red-500);
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px;
}

.stat-card-simple {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-card-simple .stat-icon {
    font-size: 28px;
}

.stat-card-simple .stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-card-simple .stat-label {
    font-size: 12px;
    color: var(--gray-500);
}

.stat-card-simple .stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Protocol Stats Grid (old app style) */
.protocol-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

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

.stat-card {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card .stat-sub {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.weekly-stats-panel {
    padding: 0;
}

/* Info Rows */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.info-row .info-label {
    font-size: 13px;
    color: var(--gray-500);
}

.info-row .info-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

/* Metrics Container */
.metrics-container {
    padding: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.metric-card {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.metric-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.metric-chart-placeholder {
    height: 160px;
    display: flex;
    flex-direction: column;
}

.chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 8px 0;
}

.chart-bars .chart-bar {
    flex: 1;
    background: var(--orange-500);
    border-radius: 4px 4px 0 0;
    min-height: 8px;
}

.chart-bars.green .chart-bar {
    background: var(--green-500);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
}

.chart-labels span {
    font-size: 10px;
    color: var(--gray-400);
}

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

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-tab-nav {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .page-filters {
        flex-wrap: wrap;
    }
}
