/* === RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* === HEADER === */
.top-bar {
    background: #111;
    padding: 8px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid #222;
}
.top-bar .contact-info span { margin-right: 20px; color: #ccc; }
.top-bar .social-icons a {
    color: #ccc;
    margin-left: 10px;
    font-size: 16px;
}

header {
    background: #111;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #c8962e;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo h1 {
    font-size: 22px;
    color: #c8962e;
    font-weight: 700;
}
.logo small { color: #999; font-size: 11px; display: block; }

nav { display: flex; align-items: center; gap: 5px; }
nav a {
    color: #ddd;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s;
}
nav a:hover, nav a.active {
    background: #c8962e;
    color: #000;
}
.btn-login {
    border: 1px solid #c8962e;
    color: #c8962e !important;
    margin-left: 10px;
}
.btn-login:hover { background: #c8962e; color: #000 !important; }

/* === MAIN LAYOUT === */
.main-container {
    display: flex;
    min-height: calc(100vh - 120px);
}

/* === SIDEBAR === */
.sidebar {
    width: 280px;
    background: #111;
    padding: 20px;
    border-right: 1px solid #222;
    flex-shrink: 0;
}
.sidebar h3 {
    color: #c8962e;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}
.sidebar-menu { list-style: none; }
.sidebar-menu li {
    margin-bottom: 4px;
}
.sidebar-menu a {
    display: block;
    padding: 12px 18px;
    background: #c8962e;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background: #e0ac3a;
    transform: translateX(4px);
}

/* === CONTENT AREA === */
.content {
    flex: 1;
    padding: 25px 30px;
}
.page-title {
    font-size: 28px;
    color: #c8962e;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
}

/* === SEARCH BOX === */
.search-container {
    max-width: 700px;
    margin: 0 auto 30px;
    position: relative;
}
.search-container input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}
.search-container input:focus { border-color: #c8962e; }
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.search-results .result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: background 0.2s;
}
.search-results .result-item:hover { background: #252525; }
.search-results .result-item .code { color: #c8962e; font-size: 12px; }
.search-results .result-item .name { color: #ddd; font-size: 14px; }

/* === CARDS === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.card {
    background: #151515;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}
.card:hover {
    border-color: #c8962e;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(200, 150, 46, 0.1);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    flex: 1;
}
.card-code { color: #888; font-size: 12px; margin-top: 4px; }
.card-nav {
    text-align: right;
}
.card-nav .nav-value {
    font-size: 22px;
    font-weight: 700;
    color: #c8962e;
}
.card-nav .nav-date { font-size: 11px; color: #666; }

.card-body { margin-top: 12px; }
.card-body .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #1e1e1e;
    font-size: 13px;
}
.stat-label { color: #888; }
.stat-value { color: #ddd; font-weight: 500; }
.positive { color: #4caf50 !important; }
.negative { color: #f44336 !important; }

.card-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.card-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 80px;
}

/* === BUTTONS === */
.btn-primary {
    background: #c8962e;
    color: #000;
}
.btn-primary:hover { background: #e0ac3a; }
.btn-secondary {
    background: #252525;
    color: #ddd;
    border: 1px solid #333 !important;
}
.btn-secondary:hover { background: #333; }
.btn-danger {
    background: #f44336;
    color: #fff;
}
.btn-danger:hover { background: #d32f2f; }
.btn-full {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
}
.btn-sm {
    padding: 5px 10px !important;
    font-size: 11px !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* === MARKET OVERVIEW === */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.market-card {
    background: #151515;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s;
}
.market-card:hover {
    border-color: #c8962e;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(200, 150, 46, 0.1);
}
.market-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.market-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.market-type {
    background: #252525;
    color: #c8962e;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.market-card-body {
    margin-bottom: 10px;
}
.market-nav {
    font-size: 24px;
    font-weight: 700;
    color: #c8962e;
    margin-bottom: 4px;
}
.market-change {
    font-size: 14px;
    font-weight: 600;
}
.market-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #222;
    font-size: 13px;
    color: #888;
}

/* === QUICK ACTIONS === */
.quick-actions {
    background: #111;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 25px;
    margin-top: 10px;
}
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}
.action-card {
    background: #1a1a1a;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}
.action-card:hover {
    border-color: #c8962e;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(200, 150, 46, 0.15);
}
.action-icon {
    font-size: 32px;
    margin-bottom: 10px;
}
.action-label {
    font-size: 14px;
    font-weight: 700;
    color: #c8962e;
    margin-bottom: 5px;
}
.action-desc {
    font-size: 11px;
    color: #888;
}

/* === NFO LIST === */
.nfo-list { list-style: none; }
.nfo-item {
    background: #151515;
    border: 1px solid #252525;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s;
}
.nfo-item:hover { border-color: #c8962e; }
.nfo-name { font-size: 15px; font-weight: 500; color: #ddd; }
.nfo-date { font-size: 13px; color: #888; margin-top: 4px; }
.nfo-badge {
    background: #c8962e;
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.nfo-badge-inactive {
    background: #555;
    color: #ddd;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* === FACTSHEET === */
.factsheet-container {
    max-width: 900px;
    margin: 0 auto;
}
.factsheet-header {
    background: #151515;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.factsheet-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.factsheet-meta {
    color: #888;
    font-size: 13px;
    margin-top: 4px;
}
.factsheet-nav-box {
    text-align: right;
    flex-shrink: 0;
}
.factsheet-nav {
    font-size: 28px;
    font-weight: 700;
    color: #c8962e;
}
.factsheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.factsheet-section {
    background: #151515;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 20px;
}
.factsheet-section h4 {
    color: #c8962e;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #252525;
}
.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #1a1a1a;
    font-size: 13px;
}
.metric-row span:first-child { color: #888; }
.metric-row span:last-child { color: #ddd; font-weight: 500; }

/* === SIP PERFORMANCE SUMMARY === */
.perf-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.perf-summary-item {
    background: #151515;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}
.perf-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.perf-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

/* === CATEGORY TABS === */
.category-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cat-tab {
    padding: 8px 20px;
    border: 1px solid #333;
    background: transparent;
    color: #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}
.cat-tab.active, .cat-tab:hover {
    background: #c8962e;
    color: #000;
    border-color: #c8962e;
}

/* === TABLE === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.data-table th {
    background: #1a1a1a;
    color: #c8962e;
    padding: 12px 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 2px solid #c8962e;
    white-space: nowrap;
}
.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #1e1e1e;
    font-size: 13px;
}
.data-table tr:hover { background: #1a1a1a; }

/* === SIP CALCULATOR FORM === */
.calc-form {
    max-width: 600px;
    margin: 0 auto;
    background: #151515;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #252525;
}
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    color: #c8962e;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
    outline: none;
}
.form-group input:focus, .form-group select:focus {
    border-color: #c8962e;
}

/* === SIP RESULT === */
.sip-result {
    max-width: 600px;
    margin: 20px auto;
    background: #151515;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #c8962e;
}
.sip-result h3 {
    color: #c8962e;
    margin-bottom: 15px;
    font-size: 18px;
}
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.result-item {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.result-item .label { font-size: 12px; color: #888; margin-bottom: 5px; }
.result-item .value { font-size: 20px; font-weight: 700; color: #fff; }
.result-item .value.gain { color: #4caf50; }
.result-item .value.loss { color: #f44336; }

/* === CHART CONTAINER === */
.chart-container {
    background: #151515;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}
.chart-container canvas { max-height: 350px; }
.chart-period-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}
.chart-period-btns button {
    padding: 6px 16px;
    border: 1px solid #333;
    background: transparent;
    color: #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}
.chart-period-btns button.active,
.chart-period-btns button:hover {
    background: #c8962e;
    color: #000;
    border-color: #c8962e;
}

/* === COMPARE SECTION === */
.compare-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.compare-inputs input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
}

/* === LOADER === */
.loader {
    text-align: center;
    padding: 40px;
    color: #888;
}
.loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #c8962e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === MODAL === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #151515;
    border: 1px solid #c8962e;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal h2 {
    color: #c8962e;
    margin-bottom: 20px;
}
.modal-close {
    float: right;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
}
.modal-close:hover { color: #fff; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}
.empty-state .icon { font-size: 48px; margin-bottom: 15px; }
.empty-state h3 { color: #888; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* === FOOTER === */
footer {
    background: #111;
    border-top: 1px solid #222;
    padding: 15px 30px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .main-container { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #222; }
    .sidebar-menu { display: flex; flex-wrap: wrap; gap: 5px; }
    .sidebar-menu li { flex: 1; min-width: 140px; }
    nav { display: none; }
    .card-grid { grid-template-columns: 1fr; }
    .result-grid { grid-template-columns: 1fr; }
    .compare-inputs { flex-direction: column; }
    .market-grid { grid-template-columns: 1fr; }
    .factsheet-header { flex-direction: column; }
    .factsheet-grid { grid-template-columns: 1fr; }
    .perf-summary { grid-template-columns: 1fr 1fr; }
    .action-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .perf-summary { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1a1a1a;
    border: 1px solid #c8962e;
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    font-size: 14px;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c8962e; }
