:root {
    --bg-color: #050508;
    --surface: #12121e;
    --accent-primary: #7d2ae8;
    --accent-secondary: #00d2ff;
    --text-primary: #ffffff;
    --text-secondary: #8a8aa3;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --success: #00ffa3;
    --danger: #ff4d4d;
    --warning: #ffcc00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background: radial-gradient(circle at top right, rgba(125, 42, 232, 0.12), transparent 400px),
        radial-gradient(circle at bottom left, rgba(0, 210, 255, 0.08), transparent 400px);
    line-height: 1.5;
}

.app-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 100px 16px;
    /* 100px bottom for tab bar safety */
}

/* Glassmorphic Base */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 4px 0;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}

.tier-badge {
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), #9d5df5);
    text-transform: uppercase;
}

/* Horizontal Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 16px;
    border-radius: 16px;
}

.stat-label {
    display: block;
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 14px;
    font-weight: 800;
}

/* Signal Card */
.signal-card {
    padding: 24px;
    margin-bottom: 20px;
    border-left: 2px solid var(--accent-secondary);
}

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

#signal-pair {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 2px;
}

.direction-tag {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

.direction-tag.LONG {
    color: var(--success);
    background: rgba(0, 255, 163, 0.1);
}

.direction-tag.SHORT {
    color: var(--danger);
    background: rgba(255, 77, 77, 0.1);
}

.direction-tag.NONE {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* Data Rows */
.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.metric-row:last-child {
    border: none;
}

.metric-row span {
    font-size: 12px;
    color: var(--text-secondary);
}

.metric-row b {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
}

/* Content Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bottom Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 28px 0;
    /* extra padding for safe area */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 25%;
    opacity: 0.35;
    transition: 0.2s;
}

.tab-item.active {
    opacity: 1;
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
}

/* Forms & Buttons */
.section-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin: 24px 0 8px 0;
}

h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #975af1);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
}

select.btn {
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}

input.btn {
    outline: none;
}

.mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 11px;
    border-radius: 9px;
    opacity: 0.5;
}

.mode-btn.active {
    background: var(--accent-primary);
    color: #fff;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(125, 42, 232, 0.3);
}

/* History List */
.history-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Utilities */
.tier-ELITE {
    color: var(--accent-secondary);
}

.tier-PRO {
    color: var(--accent-primary);
}

.tier-FREE {
    color: var(--text-secondary);
}