:root {
    --bg-body: #0f172a;
    --bg-sidebar: #111827;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #38bdf8;
    --accent-success: #4ade80;
    --accent-danger: #f87171;
    --accent-warning: #facc15;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: block;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    height: 100dvh;
    top: 0;
    left: 0;
    z-index: 10;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}
.brand i { color: var(--accent-primary); }

.nav-menu { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; min-height: 0; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.nav-item:hover, .nav-item.active {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
}
.nav-item i { width: 18px; height: 18px; }

.user-mini {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar {
    width: 36px; height: 36px;
    background: var(--bg-card-hover);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    max-width: 1600px;
    min-width: 0; /* Prevents flexbox overflow on smaller screens */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: rgba(74, 222, 128, 0.1);
    color: var(--accent-success);
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-dot { width: 8px; height: 8px; background: currentColor; border-radius: 50%; animation: pulse 2s infinite; }

/* Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-4 { grid-column: span 4; }
.col-span-3 { grid-column: span 3; }

/* Newbie Friendly Styles */
.welcome-banner {
    grid-column: span 12;
    background: linear-gradient(to right, var(--bg-card), rgba(56, 189, 248, 0.05));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.welcome-content h2 { margin: 0 0 8px 0; font-size: 1.8rem; color: var(--text-primary); }
.welcome-content p { margin: 0; color: var(--text-secondary); font-size: 1rem; max-width: 600px; line-height: 1.5; }

.action-btn-group { display: flex; gap: 12px; margin-top: 24px; }
.btn-big { padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 8px; border: none; transition: all 0.2s; }
.btn-big:hover { transform: translateY(-2px); }
.btn-deposit-big { background: var(--accent-primary); color: var(--bg-body); box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3); }
.btn-withdraw-big { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-withdraw-big:hover { background: rgba(255,255,255,0.05); }

.btn-help {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-left: 12px;
}
.btn-help:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}

/* Demo Mode Styles */
.demo-toggle-wrapper { display: flex; align-items: center; gap: 8px; margin-right: 16px; }
.demo-label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.switch-demo { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch-demo input { opacity: 0; width: 0; height: 0; }
.slider-demo { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-card-hover); transition: .4s; border-radius: 20px; }
.slider-demo:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider-demo { background-color: #ef4444; }
input:checked + .slider-demo:before { transform: translateX(20px); }

.demo-mode-card {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between;
    transition: all 0.3s ease;
}
.demo-mode-card.active { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; box-shadow: 0 0 15px rgba(239, 68, 68, 0.2); }
.demo-info { display: flex; flex-direction: column; }
.demo-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.demo-desc { font-size: 0.75rem; color: var(--text-secondary); }

body.demo-mode {
    --accent-primary: #ef4444; /* Red */
    --accent-success: #f87171; /* Lighter Red/Pink for success in demo context */
    --bg-sidebar: #1a0505;
    --bg-body: #0f0202;
    --bg-card: #2a0a0a;
    --bg-card-hover: #3f1010;
    --border-color: #451a1a;
}
body.demo-mode .status-badge { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
body.demo-mode .status-dot { background: #ef4444; }

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.card-title {
    font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--text-secondary); width: 18px; }

/* Portfolio */
.balance-wrapper { text-align: center; padding: 10px 0; }
#portfolio-balance {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-success);
    letter-spacing: -1px;
    margin-bottom: 8px;
}
.currency-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* Stats */
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.stat-box {
    background: rgba(255,255,255,0.03);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}
.stat-val { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.stat-lbl { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; margin-top: 4px; }
.btn-reset {
    width: 100%;
    padding: 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}
.btn-reset:hover { background: #475569; color: #fff; }

/* Opportunity */
.opp-visual {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: opacity 0.3s ease;
}
.opp-side { text-align: center; flex: 1; }
.opp-label { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 4px; }
.opp-ex { font-weight: 600; font-size: 1.1rem; color: var(--text-primary); }
.opp-price { font-family: var(--font-mono); color: var(--accent-primary); font-size: 0.95rem; margin-top: 4px; }
.opp-arrow { color: var(--text-secondary); display: flex; flex-direction: column; align-items: center; padding: 0 10px; }
.opp-profit {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
#opp-profit-value {
    font-size: 2.5rem; font-weight: 700; font-family: var(--font-mono);
}
.profit-positive { color: var(--accent-success); }
.profit-negative { color: var(--accent-danger); }
.profit-neutral { color: var(--text-secondary); }

#opp-status { font-size: 0.9rem; font-weight: 500; }
.status-searching { color: var(--accent-warning); animation: pulse 1.5s infinite; }
.status-found { color: var(--accent-success); }

@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
#opp-status.status-searching::after {
    content: "";
    animation: dots 1.5s infinite;
    display: inline-block;
    width: 16px;
    text-align: left;
}

/* Level */
.level-info { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.9rem; }
.level-val { font-weight: 600; }
.code-box { font-family: var(--font-mono); background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; }
.progress-container { margin-top: 16px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
.progress-track { height: 6px; background: var(--bg-card-hover); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-primary); width: 0%; transition: width 0.5s; }

/* Prices List */
#price-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 4px; }
.price-item {
    display: flex; justify-content: space-between;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    font-size: 0.9rem;
}
.price-item .ex { color: var(--text-secondary); }
.price-item .val { font-family: var(--font-mono); font-weight: 500; }

/* History Table */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; padding: 12px; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border-color); }
td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.03); font-family: var(--font-mono); color: var(--text-primary); }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Log */
#log-container {
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 16px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}
.log-entry { margin-bottom: 4px; }
.log-info { color: #94a3b8; }
.log-header { color: #38bdf8; font-weight: 700; margin: 8px 0; display: block; border-bottom: 1px dashed #333; padding-bottom: 4px; }
.log-success { color: #4ade80; }
.log-failure { color: #f87171; }
.new-entry { animation: fadeIn 0.3s ease; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes balanceFlash { 0% { color: var(--accent-success); transform: scale(1); } 50% { color: #fff; transform: scale(1.1); } 100% { color: var(--accent-success); transform: scale(1); } }
@keyframes highlightFade { 0% { background-color: rgba(250, 204, 21, 0.2); } 100% { background-color: transparent; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.new-row-highlight { animation: highlightFade 4s ease-out forwards; }
.balance-update { animation: balanceFlash 0.6s ease; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Mobile Toggle */
.mobile-toggle { 
    display: none; 
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-primary); 
    cursor: pointer; 
    padding: 10px; 
    margin-right: 16px; 
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-toggle:hover {
    background: var(--accent-primary);
    color: #0f172a;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9; backdrop-filter: blur(2px); }

@media (max-width: 1024px) {
    .sidebar { 
        transform: translateX(-100%); 
        transition: transform 0.3s ease-in-out;
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .sidebar.active { transform: translateX(0); }
    .mobile-toggle { display: block; }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; padding: 16px; }
    
    /* Better Header Response */
    .header {
        flex-wrap: wrap;
        gap: 16px;
    }
    .header > div:first-child {
        width: 100%;
        justify-content: space-between;
    }
    .header > div:last-child {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Grid Adjustments */
    .col-span-8, .col-span-6, .col-span-4, .col-span-3 { grid-column: span 12; }
    
    .calc-body { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 640px) {
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .welcome-banner > div:last-child {
        width: 100%;
        text-align: left !important;
    }
    .dashboard-grid { gap: 16px; }
    .card { padding: 16px; }
    .action-btn-group { flex-direction: column; width: 100%; }
    .btn-big { width: 100%; justify-content: center; }
}

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 100; align-items: center; justify-content: center; backdrop-filter: blur(4px); padding: 16px; overflow-y: auto; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; width: 100%; max-width: 500px; padding: 24px; position: relative; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); max-height: 85vh; overflow-y: auto; margin: auto; }
.modal-close { position: sticky; top: 0; float: right; margin-top: -12px; margin-right: -12px; background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-secondary); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 50; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.modal-close:hover { color: var(--text-primary); border-color: var(--accent-primary); }
.modal-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.crypto-option { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.crypto-option:hover { background: rgba(56, 189, 248, 0.1); border-color: var(--accent-primary); }
.address-box { background: #000; padding: 12px; border-radius: 6px; font-family: var(--font-mono); font-size: 0.85rem; word-break: break-all; margin-top: 12px; border: 1px dashed var(--border-color); display: none; }
.copy-btn { margin-top: 8px; width: 100%; background: var(--accent-primary); color: var(--bg-body); border: none; padding: 8px; border-radius: 6px; font-weight: 600; cursor: pointer; display: none; }

.deposit-history-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.85rem; }
.deposit-history-table th { text-align: left; color: var(--text-secondary); padding: 8px; border-bottom: 1px solid var(--border-color); font-weight: 500; }
.deposit-history-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-primary); }
.status-pending { color: var(--accent-warning); }
.status-confirmed { color: var(--accent-success); }

/* Tabs & Forms */
.modal-tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.modal-tab { flex: 1; padding: 12px; text-align: center; cursor: pointer; color: var(--text-secondary); font-weight: 500; border-bottom: 2px solid transparent; transition: all 0.2s; }
.modal-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.form-input { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); padding: 10px; border-radius: 6px; color: var(--text-primary); font-family: var(--font-mono); }
.form-input:focus { outline: none; border-color: var(--accent-primary); }
.btn-primary { width: 100%; background: var(--accent-primary); color: var(--bg-body); border: none; padding: 12px; border-radius: 6px; font-weight: 700; cursor: pointer; margin-top: 8px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
    .modal { width: 100%; padding: 16px; max-height: 80vh; }
}

/* Shepherd Tour Custom Theme */
.shepherd-element { background: #1e293b !important; border: 1px solid var(--accent-primary); color: var(--text-primary); border-radius: 12px; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.shepherd-header { background: transparent; border-bottom: 1px solid var(--border-color); padding: 16px; }
.shepherd-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.shepherd-text { padding: 16px; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }
.shepherd-footer { padding: 0 16px 16px; }
.shepherd-button { background: var(--accent-primary); color: #0f172a; border-radius: 6px; font-weight: 700; padding: 8px 16px; border: none; cursor: pointer; transition: opacity 0.2s; margin-left: 8px; }
.shepherd-button:hover { opacity: 0.9; }
.shepherd-button-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.shepherd-button-secondary:hover { color: var(--text-primary); border-color: var(--text-secondary); background: rgba(255,255,255,0.05); }
.shepherd-arrow:before { background: var(--bg-card) !important; }

/* Level Up Modal */
.level-up-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 200;
    align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.level-up-overlay.active { display: flex; animation: fadeIn 0.5s; }
.level-up-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid var(--accent-primary);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 60px rgba(56, 189, 248, 0.4);
    transform: scale(0.8);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    max-width: 400px; width: 90%;
    position: relative;
    overflow: hidden;
}
.level-up-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(56,189,248,0.1) 0%, transparent 70%);
    animation: spin 10s linear infinite;
    z-index: 0;
}
.level-up-content { position: relative; z-index: 1; }
.level-up-icon {
    width: 80px; height: 80px; background: var(--accent-primary);
    color: #0f172a; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 0 30px var(--accent-primary);
    animation: bounce 2s infinite;
}
.level-up-icon i { width: 40px; height: 40px; }
.level-up-title { font-size: 2rem; font-weight: 800; margin: 0 0 8px 0; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.level-up-desc { color: var(--text-secondary); margin-bottom: 32px; font-size: 1.1rem; }
.level-highlight { color: var(--accent-primary); font-weight: 700; font-size: 1.3rem; }

@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } }
@keyframes flash-green { 
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); border-color: var(--accent-success); } 
    100% { box-shadow: 0 0 0 20px rgba(74, 222, 128, 0); border-color: var(--border-color); } 
}
.card-flash { animation: flash-green 1s ease-out; }

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 99px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { display: flex; align-items: center; justify-content: center; }
.toast-success .toast-icon { color: var(--accent-success); }
.toast-demo .toast-icon { color: #ef4444; }

/* Calculator & Levels Specific Styles */
.calc-container {
    background: linear-gradient(145deg, var(--bg-card), #162032);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 48px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.calc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }

.input-group-modern { margin-bottom: 24px; }
.input-group-modern label { display: block; color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 8px; font-weight: 500; }
.input-wrapper { position: relative; }
.input-wrapper.big i { width: 24px; height: 24px; left: 20px; color: var(--accent-primary); }
.input-wrapper i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); width: 18px; }
.modern-input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    padding: 16px 16px 16px 48px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-mono);
    transition: all 0.2s;
}
.input-wrapper.big .modern-input { padding: 20px 20px 20px 60px; font-size: 1.5rem; font-weight: 700; }
.modern-input:focus { outline: none; border-color: var(--accent-primary); background: rgba(56, 189, 248, 0.05); }

/* Results Area */
.results-card {
    background: rgba(255,255,255,0.02);
    border-radius: 24px;
    padding: 32px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.result-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.result-row:last-child { border-bottom: none; }
.res-label { color: var(--text-secondary); font-size: 0.9rem; }
.res-val { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
.res-val.highlight { color: var(--accent-success); font-size: 1.5rem; }
.res-sub { font-size: 0.75rem; color: var(--text-secondary); text-align: right; margin-top: 4px; }

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
}
@media (max-width: 1024px) { .sidebar-close { display: block; } }
.profit-hero { margin-bottom: 24px; }
.profit-hero-label { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.profit-hero-val { font-size: 2.5rem; font-weight: 800; color: var(--accent-success); line-height: 1; font-family: var(--font-mono); text-shadow: 0 0 30px rgba(74, 222, 128, 0.2); }
.profit-hero-sub { font-size: 1rem; color: var(--text-secondary); margin-top: 8px; }

/* Level Cards Redesign */
.levels-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.lvl-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0.6;
    filter: grayscale(0.3);
}

.lvl-card.active {
    opacity: 1;
    filter: grayscale(0);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
    transform: translateY(-5px);
    z-index: 2;
}

.lvl-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.lvl-badge { 
    background: var(--bg-card-hover); color: var(--text-secondary); 
    padding: 4px 12px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.lvl-card.active .lvl-badge { background: var(--accent-primary); color: #0f172a; }

.lvl-number { font-size: 2rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.lvl-name { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

.lvl-stats { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.lvl-stat { display: flex; justify-content: space-between; font-size: 0.9rem; }
.stat-k { color: var(--text-secondary); }
.stat-v { font-weight: 600; font-family: var(--font-mono); }

.lvl-req {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.req-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.req-item i { width: 14px; height: 14px; }
.req-met { color: var(--accent-success); }

@media (max-width: 1024px) {
    .calc-body { grid-template-columns: 1fr; gap: 32px; }
}

/* Modern Language Switcher */
.custom-lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-toggle {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.lang-toggle img {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 6px;
}

.custom-lang-dropdown.active .lang-menu {
    display: block;
    animation: fadeIn 0.2s ease;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.lang-option:hover, .lang-option.selected {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.lang-option img {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .lang-toggle {
        padding: 10px 14px;
    }
    .lang-menu {
        min-width: 200px;
    }
    .lang-option {
        padding: 12px 16px;
    }
}