/*
FlowBot Platform - Dark Theme Styles
Hyperliquid-inspired clean design
*/

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

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: #000000;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 300;
}

/* ========== TYPOGRAPHY ========== */
h1 {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 16px;
    color: #ffffff;
}

h2 {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 12px;
    color: #ffffff;
}

h3 {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 8px;
    color: #ffffff;
}

p {
    color: #9a9a9a;
    margin-bottom: 12px;
    font-weight: 300;
}

/* ========== LAYOUT ========== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    width: 95%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 32px;
    min-height: 80px;
}

/* Header links - prevent jumping on hover/active states */
.header a {
    font-weight: 300;
    transition: color 0.2s ease;
    color: #c0c0c0;
}

.header a:hover {
    opacity: 0.8;
    color: #ffffff;
}

.logo {
    font-size: 18px;
    font-weight: 400;
    color: #ffffff;
}

/* Balance display - prevent jumping when value updates */
#balance-display {
    min-width: 140px;
}

#balance-value {
    min-width: 60px;
    display: inline-block;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.access-key-display {
    color: #a0a0a0;
    font-size: 14px;
}

/* ========== CARDS ========== */
.card {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
    position: relative;
}

.card:hover {
    background-color: #2a2a2a;
}

/* ========== BUTTONS ========== */
button, .btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms ease;
    border: 1px solid #3a3a3a;
    background: transparent;
    color: #e0e0e0;
    min-height: 38px;
    width: 100%;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

button:hover, .btn:hover {
    background-color: #2a2a2a;
}

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

.btn-primary {
    background-color: #00c805;
    border-color: #00c805;
    color: #000000;
}

.btn-primary:hover {
    background-color: #00e006;
}

.btn-danger {
    background-color: #ff3b30;
    border-color: #ff3b30;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #ff5449;
}

.btn-secondary {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #3a3a3a;
}

.btn-loading {
    position: relative;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    color: #909090;
    font-size: 12px;
    font-weight: 300;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

small {
    color: #6b6b6b;
    font-size: 11px;
    font-weight: 300;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    background-color: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    font-weight: 300;
}

select {
    padding-right: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
}

input:focus, select:focus {
    outline: none;
    border-color: #ffffff;
}

input.error {
    border-color: #ff3b30;
}

input.valid {
    border-color: #00c805;
}

.input-help {
    color: #6b6b6b;
    font-size: 12px;
    margin-top: 4px;
}

.input-error {
    color: #ff3b30;
    font-size: 12px;
    margin-top: 4px;
}

.input-success {
    color: #00c805;
    font-size: 12px;
    margin-top: 4px;
}

.checkmark {
    color: #00c805;
    margin-left: 8px;
}

/* ========== METRICS GRID ========== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.metric-card {
    background-color: #1a1a1a;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.metric-label {
    color: #909090;
    font-size: 11px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 24px;
    font-weight: 400;
    font-family: 'Inter', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-variant-numeric: tabular-nums;
}

.metric-value.positive {
    color: #00c805;
}

.metric-value.negative {
    color: #ff3b30;
}

/* ========== STATUS SECTION ========== */
.status-section {
    text-align: center;
    margin: 36px 0;
}

.bot-status {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 8px;
}

.bot-status.running {
    color: #00c805;
}

.bot-status.stopped {
    color: #909090;
}

.market-label {
    color: #909090;
    font-size: 13px;
    font-weight: 300;
    margin-bottom: 18px;
}

.pnl-card {
    background-color: #1a1a1a;
    padding: 28px;
    border-radius: 8px;
    margin: 20px 0;
}

.pnl-value {
    font-size: 40px;
    font-weight: 400;
    font-family: 'Inter', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

.pnl-label {
    color: #909090;
    font-size: 12px;
    font-weight: 300;
    text-transform: uppercase;
}

/* ========== ALERTS & NOTIFICATIONS ========== */
.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 300;
}

.alert-warning {
    background-color: rgba(255, 214, 10, 0.1);
    border: 1px solid #ffd60a;
    color: #ffd60a;
}

.alert-success {
    background-color: rgba(0, 200, 5, 0.1);
    border: 1px solid #00c805;
    color: #00c805;
}

.alert-error {
    background-color: rgba(255, 59, 48, 0.1);
    border: 1px solid #ff3b30;
    color: #ff3b30;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 400;
    font-size: 13px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 300ms ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background-color: #00c805;
    color: #000000;
}

.toast.error {
    background-color: #ff3b30;
}

.toast.warning {
    background-color: #CFB035;
    color: #000000;
}

/* Hide number input spinners */
input[type="number"].max-loss-input::-webkit-outer-spin-button,
input[type="number"].max-loss-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"].max-loss-input {
    -moz-appearance: textfield;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== OVERLAY & MODAL ========== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

#loading-overlay, #loading-overlay-1, #loading-overlay-2, #loading-overlay-3, #loading-overlay-4 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.modal {
    background-color: #1a1a1a;
    padding: 32px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.spinner {
    border: 3px solid #3a3a3a;
    border-top-color: #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

/* ========== FEATURE LIST ========== */
.features {
    margin: 40px 0;
}

.feature-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
}

.feature-item::before {
    content: "✓";
    color: #00c805;
    font-size: 20px;
    margin-right: 12px;
}

/* ========== STEPS ========== */
.steps {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6b6b6b;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 16px;
    left: 60%;
    width: 80%;
    height: 2px;
    background-color: #3a3a3a;
    z-index: -1;
}

.step.active {
    color: #ffffff;
}

.step.complete {
    color: #00c805;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #1a1a1a;
    border: 2px solid #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-weight: 500;
}

.step.active .step-number {
    border-color: #ffffff;
    background-color: #ffffff;
    color: #000000;
}

.step.complete .step-number {
    background-color: #00c805;
    border-color: #00c805;
    color: #000000;
}

.step-label {
    font-size: 12px;
    text-align: center;
}

.step-divider {
    width: 40px;
    height: 2px;
    background-color: #3a3a3a;
    margin: 0 16px;
}

/* ========== COPY FIELD ========== */
.copy-field {
    position: relative;
}

.copy-field input {
    padding-right: 60px;
}

.copy-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #2a2a2a;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #ffffff;
    min-height: auto;
    width: auto;
    max-width: none;
}

.copy-btn:hover {
    background-color: #3a3a3a;
}

/* ========== SEARCHING INDICATOR ========== */
.searching-indicator {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: 50%;
    background-color: #01BC85;
    animation: pulse 2s ease-in-out infinite;
}

.searching-indicator.extended {
    background-color: #01BC85;
}

.searching-indicator.hyperliquid {
    background-color: #50D2C1;
}

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

@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.status-indicator-pulse {
    animation: pulse-slow 2.5s ease-in-out infinite;
}

/* ========== UTILITIES ========== */
.text-center {
    text-align: center;
}

.text-muted {
    color: #707070;
    font-weight: 300;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden {
    display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .pnl-value {
        font-size: 36px;
    }

    .metric-value {
        font-size: 22px;
    }

    h1 {
        font-size: 28px;
    }

    .steps {
        font-size: 14px;
    }

    .step-divider {
        width: 20px;
    }
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #1a1a1a;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #3a3a3a;
}

.modal-body {
    padding: 24px;
}

.modal-details {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #3a3a3a;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #ffffff;
}

.modal-detail-row:not(:last-child) {
    border-bottom: 1px solid #3a3a3a;
}

.modal-detail-row span:first-child {
    color: #909090;
    font-size: 13px;
    font-weight: 300;
}

.modal-detail-row span:last-child {
    font-weight: 400;
    font-size: 14px;
}

.modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
}

.modal-footer .btn {
    max-width: none;
}

/* ========== SMOOTH UPDATES ========== */
/* Smooth transition for updating values to reduce visual jumping */
.smooth-update {
    transition: opacity 0.3s ease-in-out;
}

.smooth-update.updating {
    opacity: 0.6;
}
