:root {
    --bg-dark: #0a0b0d;
    --bg-card: #15181c;
    --bg-hover: #1e2228;
    --text-main: #eaecef;
    --text-sub: #848e9c;
    --gold: #f0b90b;
    --green: #0ecb81;
    --red: #f6465d;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --border: #2b3139;
}
* { box-sizing: border-box; margin:0; padding:0; font-family: 'Segoe UI', Roboto, Helvetica, sans-serif; }
body { background: var(--bg-dark); color: var(--text-main); padding: 10px; font-size: 14px; }
.app-wrapper { max-width: 1900px; margin: 0 auto; display:flex; flex-direction:column; gap:15px; }

header { background: var(--bg-card); padding:20px; border-radius:8px; border:1px solid var(--border); }
.brand { text-align:center; margin-bottom:14px; }

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 35px 8px 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    width: 250px;
}

.search-container i {
    position: absolute;
    right: 12px;
    color: var(--text-sub);
    pointer-events: none;
}

.btn-auth {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-auth:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-1px);
}

.btn-auth-primary {
    background: linear-gradient(135deg, var(--gold), #d4a406);
    border: none;
    color: #000;
}

.btn-auth-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 185, 11, 0.3);
}

.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(240, 185, 11, 0.2);
    flex-wrap: wrap;
}

.nav-link-gold {
    color: var(--gold);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid var(--gold);
    background: rgba(240, 185, 11, 0.05);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link-gold:hover {
    background: var(--gold);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 185, 11, 0.3);
}

.nav-link-gold i {
    font-size: 1.1rem;
}

.nav-time {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-sub);
    padding: 10px;
}

h1 { font-size: 1.6rem; margin:0; }
h1 span { color: var(--gold); }
.controls-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap:12px; align-items:end; }
.control-group { display:flex; flex-direction:column; gap:6px; }
label { font-size:0.75rem; color:var(--text-sub); text-transform:uppercase; font-weight:600; }
select, .btn-tool, .btn-action { background:var(--bg-dark); color:var(--text-main); border:1px solid var(--border); padding:10px 12px; border-radius:6px; cursor:pointer; }
.btn-action { background: linear-gradient(135deg, var(--gold), #d4a406); color:#000; font-weight:700; border:none; }

.collapsible-panel {
    margin-top: 12px;
    border: 1px solid rgba(240,185,11,0.08);
    border-radius: 6px;
    background: rgba(240,185,11,0.02);
    overflow: hidden;
}
.collapsible-header {
    padding: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(240,185,11,0.05);
    user-select: none;
}
.collapsible-header:hover {
    background: rgba(240,185,11,0.1);
}
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 12px;
}
.collapsible-content.active {
    max-height: 1000px;
    padding: 12px;
}
.chevron {
    transition: transform 0.3s ease;
}
.chevron.active {
    transform: rotate(180deg);
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}
.indicator-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.indicator-item input[type="checkbox"] {
    cursor: pointer;
}

.kpi-dashboard { display:grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap:12px; }
.card { background:var(--bg-card); border:1px solid var(--border); border-radius:8px; padding:12px; }
.card-head { color:var(--text-sub); font-size:0.85rem; text-transform:uppercase; font-weight:600; margin-bottom:8px; border-bottom:1px solid var(--border); padding-bottom:8px; }
.price-main { font-size:2rem; font-weight:800; }
.price-sub { font-size:1.2rem; font-weight:600; margin-top:6px; }

.chart-layout { width:100%; height:750px; }
.chart-box { height:100%; padding:0; overflow:hidden; }
#mainChart { width:100%; height:100%; }

.prediction-section { display:grid; grid-template-columns:2fr 1fr; gap:12px; margin-top:12px; }
.simulation-card { display:flex; flex-direction:column; min-height:400px; }

.analysis-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap:12px; margin-top:12px; }

.loader-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background: rgba(10,11,13,0.95); z-index:1000; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.spinner { width:60px; height:60px; border:5px solid var(--border); border-top:5px solid var(--gold); border-radius:50%; animation:spin 1s linear infinite; margin-bottom:20px; }
@keyframes spin { 100% { transform:rotate(360deg); } }

.info-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 4px 0;
}
.badge-trend { background: var(--green); color: #000; }
.badge-range { background: var(--gold); color: #000; }
.badge-squeeze { background: var(--red); color: #fff; }

.error-display {
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid var(--red);
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    color: var(--red);
    font-weight: 600;
    display: none;
}

@media (max-width:1200px) {
    .prediction-section { grid-template-columns:1fr; }
    .analysis-grid { grid-template-columns:1fr; }
}

.info-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 13, 0.95);
    overflow: auto;
}

.search-results {
    position: absolute;
    top: 45px;
    right: 0;
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(240, 185, 11, 0.1);
}

.result-title {
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-snippet {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.4;
}

.result-snippet mark {
    background: var(--gold);
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
}

.no-results {
    color: var(--text-sub);
    text-align: center;
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
}

.auth-error {
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    display: none;
}

.auth-error:not(:empty) {
    display: block;
}

.info-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 13, 0.95);
    overflow: auto;
}

.info-modal-content {
    background: var(--bg-card);
    margin: 2% auto;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.info-modal-close {
    color: var(--text-sub);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.info-modal-close:hover {
    color: var(--gold);
}

.nav-link {
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 4px;
}

.nav-link:hover {
    color: var(--gold);
    background: rgba(240, 185, 11, 0.1);
}

.nav-link i {
    margin-right: 5px;
}

@media (max-width: 1200px) {
    .prediction-section { grid-template-columns: 1fr; }
    .analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Hide charts on mobile */
    .chart-layout, .prediction-section { display: none !important; }
    
    .controls-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Hide simulation and steps on mobile */
    .control-group:has(#simCount),
    .control-group:has(#predictionSteps) {
        display: none !important;
    }
    
    /* Hide indicator panel on mobile */
    .collapsible-panel {
        display: none !important;
    }
    
    /* Mobile navigation - icons in row */
    .main-nav {
        flex-direction: row !important;
        gap: 8px !important;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link-gold span {
        display: none;
    }
    
    .nav-link-gold {
        padding: 10px;
        width: 45px;
        height: 45px;
        justify-content: center;
        align-items: center;
        font-size: 0.9rem;
    }
    
    .nav-link-gold i {
        margin: 0;
        font-size: 1.2rem;
    }
    
    .nav-time {
        display: none !important;
    }
    
    .kpi-dashboard {
        grid-template-columns: 1fr !important;
    }
    
    body { font-size: 12px; }
    
    .price-main { font-size: 1.5rem; }
    
    .info-modal-content {
        margin: 5% auto;
        padding: 15px;
        width: 95%;
    }
    
    h1 { font-size: 1.3rem !important; }
}
