/* ============================================
   Trade Journal - Dark Neon Theme
   Mobile + Tablet + Desktop Responsive
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #0A0A0F;
    --bg-secondary: #15151F;
    --bg-card: #1C1C2A;
    --bg-hover: #252535;
    --border: #2A2A3D;
    --text-primary: #FFFFFF;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --neon-blue: #00D4FF;
    --neon-purple: #A855F7;
    --neon-green: #00FF88;
    --neon-red: #FF3366;
    --neon-yellow: #FFB800;
    --gradient: linear-gradient(135deg, #00D4FF 0%, #A855F7 100%);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --shadow-purple: 0 0 20px rgba(168, 85, 247, 0.3);
}

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

a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--neon-purple);
}

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}

.navbar-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-menu a:hover, .navbar-menu a.active {
    color: var(--neon-blue);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 48px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    color: white;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--neon-blue);
}

.btn-success { background: var(--neon-green); color: #000; }
.btn-danger { background: var(--neon-red); color: white; }
.btn-large { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.stat-value.profit { color: var(--neon-green); }
.stat-value.loss { color: var(--neon-red); }
.stat-value.neon { color: var(--neon-blue); }

.stat-change {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.stat-change.up { color: var(--neon-green); }
.stat-change.down { color: var(--neon-red); }

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-textarea { min-height: 100px; resize: vertical; }

/* ===== BUY/SELL TOGGLE ===== */
.toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.toggle-btn {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.buy.active {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.toggle-btn.sell.active {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--neon-red);
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

/* ===== ALERTS ===== */
.alert-box {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background: rgba(0, 255, 136, 0.1); border-color: var(--neon-green); color: var(--neon-green); }
.alert-danger { background: rgba(255, 51, 102, 0.1); border-color: var(--neon-red); color: var(--neon-red); }
.alert-warning { background: rgba(255, 184, 0, 0.1); border-color: var(--neon-yellow); color: var(--neon-yellow); }
.alert-info { background: rgba(0, 212, 255, 0.1); border-color: var(--neon-blue); color: var(--neon-blue); }

/* ===== INSIGHT CARDS ===== */
.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.insight-card:hover {
    transform: translateX(5px);
    border-color: var(--neon-purple);
}

.insight-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(168, 85, 247, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.insight-icon.warning { background: rgba(255, 184, 0, 0.15); }
.insight-icon.danger { background: rgba(255, 51, 102, 0.15); }
.insight-icon.success { background: rgba(0, 255, 136, 0.15); }

.insight-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.insight-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== TABLES ===== */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    overflow-x: auto;
}

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

.table th {
    text-align: left;
    padding: 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

.table tr:hover {
    background: var(--bg-hover);
}

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

.badge-buy { background: rgba(0, 255, 136, 0.15); color: var(--neon-green); }
.badge-sell { background: rgba(255, 51, 102, 0.15); color: var(--neon-red); }
.badge-success { background: rgba(0, 255, 136, 0.15); color: var(--neon-green); }
.badge-warning { background: rgba(255, 184, 0, 0.15); color: var(--neon-yellow); }
.badge-info { background: rgba(0, 212, 255, 0.15); color: var(--neon-blue); }
.badge-danger { background: rgba(255, 51, 102, 0.15); color: var(--neon-red); }

/* ===== LAYOUT ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

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

.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ===== HERO ===== */
.hero {
    padding: 4rem 2rem;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(168, 85, 247, 0.15), transparent 70%),
                radial-gradient(ellipse at bottom, rgba(0, 212, 255, 0.1), transparent 70%);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== FEATURES ===== */
.features {
    padding: 4rem 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* ===== PRICING ===== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.pricing-card:hover { transform: translateY(-5px); }

.pricing-card.popular {
    border-color: var(--neon-purple);
    box-shadow: var(--shadow-purple);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient);
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
}

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

.pricing-features {
    list-style: none;
    margin-bottom: 1.5rem;
    text-align: left;
}

.pricing-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-features li::before {
    content: '✓';
    color: var(--neon-green);
    font-weight: 700;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.footer-brand h3 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; }

.footer-col h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.1), transparent 70%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

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

/* ===== SIDEBAR LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

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

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-align: center;
}

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

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-menu a.active {
    background: rgba(0, 212, 255, 0.1);
    color: var(--neon-blue);
    border-left: 3px solid var(--neon-blue);
}

.sidebar-menu a .icon {
    font-size: 1.2rem;
}

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

.mobile-header {
    display: none;
    background: var(--bg-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    align-items: center;
    justify-content: space-between;
}

/* ===== QR CODE BOX ===== */
.qr-box {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    margin: 1.5rem auto;
    max-width: 280px;
}

.qr-box img { width: 100%; height: auto; }

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
}

@media (max-width: 768px) {
    .navbar { padding: 1rem; }
    .menu-toggle { display: block; }
    
    .navbar-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        background: var(--bg-secondary);
        flex-direction: column;
        width: 80%;
        height: calc(100vh - 60px);
        padding: 2rem;
        transition: right 0.3s;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .navbar-menu.active { right: 0; }
    
    .container { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.5rem; }
    .page-title { font-size: 1.4rem; }
    
    .sidebar {
        transform: translateX(-100%);
        width: 80%;
    }
    
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .mobile-header { display: flex; }
    
    .footer-grid { grid-template-columns: 1fr; }
    .hero { padding: 2.5rem 1rem; }
    .hero h1 { font-size: 1.8rem; }
    .pricing-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .toggle-group { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.6rem; }
    .btn-large { padding: 0.85rem 1.5rem; font-size: 1rem; }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-success { color: var(--neon-green); }
.text-danger { color: var(--neon-red); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-blue); }
