/* ═══════════════════════════════════════════════════════════════
   TRADER HUB PRO V3 - Main Stylesheet
   © 2024-2025 Ring Ring Productions LLC
   ═══════════════════════════════════════════════════════════════ */

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

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

:root {
    /* Primary Colors - Blue Gradient Theme */
    --primary-color: #2a5298;
    --primary-dark: #1e3c72;
    --primary-light: #3b82f6;
    
    /* Success - Green */
    --success-color: #4caf50;
    --success-light: #e8f5e9;
    --success-dark: #2e7d32;
    
    /* Premium - Purple */
    --premium-color: #9c27b0;
    --premium-light: #f3e5f5;
    --premium-dark: #7b1fa2;
    
    /* Warning - Orange */
    --warning-color: #ff9800;
    --warning-light: #fff3e0;
    --warning-dark: #e65100;
    
    /* Error - Red */
    --error-color: #ef4444;
    --error-light: #fef2f2;
    --error-dark: #dc2626;
    
    /* Info - Blue */
    --info-color: #2196f3;
    --info-light: #e3f2fd;
    --info-dark: #1565c0;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-dark: #1e3c72;
    
    /* Border */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
    
    /* Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Touch */
    --touch-min: 44px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ═══════════════════════════════════════════════════════════════
   DARK THEME (SURGICAL ADD)
   ═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --text-primary: #e8eaf0;
    --text-secondary: #a0a4b4;
    --text-muted: #6b7080;
    
    --bg-primary: #0f1117;
    --bg-secondary: #161923;
    --bg-card: #1a1d27;
    --bg-dark: #0a0c14;
    
    --border-color: #2a2d3a;
    --border-light: #252838;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.35);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.4);
    
    --success-light: #122a18;
    --success-dark: #4ade80;
    --premium-light: #1e1a3a;
    --premium-dark: #c084fc;
    --warning-light: #2a2010;
    --warning-dark: #fbbf24;
    --error-light: #2a1215;
    --error-dark: #fca5a5;
    --info-light: #101e30;
    --info-dark: #60a5fa;
}

[data-theme="dark"] .header {
    background: linear-gradient(135deg, #0f1729 0%, #1a2744 100%);
}

[data-theme="dark"] .footer {
    background: #0a0c14;
}

[data-theme="dark"] .sidebar-nav a:hover,
[data-theme="dark"] .sidebar-nav button:hover {
    background: #1e2130;
}

[data-theme="dark"] .sidebar-nav a.active,
[data-theme="dark"] .sidebar-nav button.active {
    background: #101e30;
}

[data-theme="dark"] .lang-selector select {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control {
    background: var(--bg-secondary);
}

[data-theme="dark"] .tool-card:hover {
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.3);
}

[data-theme="dark"] .btn {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .btn:hover {
    background: #1e2130;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-premium,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-warning {
    color: white;
}

[data-theme="dark"] .feature-box-green {
    background: var(--success-light);
}

[data-theme="dark"] .feature-box-blue {
    background: var(--info-light);
}

[data-theme="dark"] .feature-box-purple {
    background: var(--premium-light);
}

[data-theme="dark"] .feature-box-orange {
    background: var(--warning-light);
}
/* ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

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

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 800px;
}

/* ═══════════════════════════════════════════════════════════════
   LANGUAGE SELECTOR
   ═══════════════════════════════════════════════════════════════ */

.lang-selector {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.lang-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all var(--transition);
}

.lang-selector select:hover {
    border-color: var(--primary-color);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
}

.title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.welcome-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-public {
    border-left: 5px solid var(--success-color);
}

.card-member {
    border-left: 5px solid var(--premium-color);
}

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

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.75rem;
}

.badge-free {
    background: var(--success-color);
    color: white;
}

.badge-premium {
    background: linear-gradient(135deg, var(--premium-color), #673ab7);
    color: white;
}

.badge-basic {
    background: var(--warning-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   FEATURE BOX
   ═══════════════════════════════════════════════════════════════ */

.feature-box {
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.feature-box strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.feature-box p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.feature-box-green {
    background: var(--success-light);
    border-left: 4px solid var(--success-color);
}

.feature-box-blue {
    background: var(--info-light);
    border-left: 4px solid var(--info-color);
}

.feature-box-purple {
    background: var(--premium-light);
    border-left: 4px solid var(--premium-color);
}

.feature-box-orange {
    background: var(--warning-light);
    border-left: 4px solid var(--warning-color);
}

/* ═══════════════════════════════════════════════════════════════
   FEATURE LIST
   ═══════════════════════════════════════════════════════════════ */

.feature-list {
    list-style: none;
    margin-bottom: 1.25rem;
}

.feature-list li {
    padding: 0.375rem 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    border: none;
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-premium {
    background: linear-gradient(135deg, var(--premium-color) 0%, #673ab7 100%);
    border: none;
    color: white;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
    border: none;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f97316 100%);
    border: none;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

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

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════ */

.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success-color);
}

.alert-error {
    background: var(--error-light);
    color: var(--error-dark);
    border: 1px solid var(--error-color);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning-color);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-dark);
    border: 1px solid var(--info-color);
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES (Login, Signup)
   ═══════════════════════════════════════════════════════════════ */

.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    cursor: pointer;
    text-align: center;
}

.tool-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.15);
    transform: translateY(-2px);
}

.tool-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.tool-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tool-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.tool-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.tool-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
}

.tool-status.available {
    background: var(--success-light);
    color: var(--success-dark);
}

.tool-status.locked {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.layout-with-sidebar {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a,
.sidebar-nav button {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav button:hover {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.sidebar-nav a.active,
.sidebar-nav button.active {
    background: var(--info-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 1.5rem;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-slow);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-dark);
    color: white;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.footer p {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.footer-link {
    padding: 0.375rem 0.75rem;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    transition: all var(--transition);
}

.footer-link:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.copyright {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }
.text-warning { color: var(--warning-color); }

.bg-primary { background: var(--bg-primary); }
.bg-card { background: var(--bg-card); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }