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

:root {
    --bg-dark-primary: #000000;
    --bg-dark-secondary: #111111;
    --bg-widget: #1c1c1c;
    --bg-trade-panel: #1A1A1A;
    --border-color: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #8a8a8a;
    --green: #00b894;
    --red: #ef4444;
    --green-bg: rgba(0, 184, 148, 0.15);
    --red-bg: rgba(239, 68, 68, 0.15);
    --font-family: 'Inter', sans-serif;
}

/* --- Base & Reset --- */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: var(--font-family);
    background-color: var(--bg-dark-primary);
    color: var(--text-primary);
    margin: 0;
    font-size: 13px;
}

/* --- App Layout --- */
#app-container { 
    display: grid; 
    grid-template-columns: 80px 1fr; 
    height: 100%; 
}

.main-content-wrapper { 
    display: grid; 
    grid-template-rows: auto 1fr auto; 
    overflow: hidden; 
    background-color: #0E0E0E; 
}

.main-area { 
    display: grid; 
    grid-template-columns: 1fr 340px; 
    gap: 16px; padding: 16px; 
    overflow-y: auto; 
    min-height: 0; 
}

.history-container-wrapper { 
    padding: 0 16px 16px; 
    background-color: var(--bg-dark-secondary); 
}

/* --- Sidebar & Nav --- */
.left-sidebar { 
    background-color: var(--bg-dark-secondary); 
    padding: 24px 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 40px; 
    grid-row: 1 / -1; 
    z-index: 10; 
}

.logo img { 
    height: 100px; 
    width: auto; 
}

.main-nav { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
}

.nav-icon { 
    font-size: 20px; 
    color: var(--text-secondary); 
    width: 50px; 
    height: 50px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    border-top: 1px solid var(--text-secondary); 
    border-bottom: 1px solid var(--text-secondary)
}

.nav-icon.active { 
    color: var(--green); 
    border-top: 1px solid var(--green); 
    border-bottom: 1px solid var(--green) 
}

.nav-icon:not(.active):hover {
    background-color: var(--bg-widget); 
    color: var(--text-primary); 
}

/* --- Header --- */
.header { 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.header-actions { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 8px 16px; 
    background-color: var(--bg-dark-secondary); 
}

.action-btn-secondary { 
    background: var(--bg-widget); 
    border: 1px solid var(--border-color); 
    color: var(--text-secondary); 
    padding: 8px 12px; 
    border-radius: 6px; 
    cursor: pointer; 
}

.action-widget { 
    background: var(--bg-widget); 
    padding: 8px 12px; 
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.action-btn-icon { 
    background: none; 
    border: none; 
    color: var(--text-secondary); 
    font-size: 18px; 
    cursor: pointer; 
}

.tradingview-ticker-tape-container iframe { 
    display: block; 
    height: 44px; 
    width: 100%; 
}

/* --- Main Content --- */
.main-column { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    min-width: 0;
}

.chart-header { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 16px; 
    padding: 12px; 
    background-color: var(--bg-dark-secondary); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
}

.chart-header-item { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex: 1 1 auto; 
}

.currency-logo { 
    width: 32px; 
    height: 32px; 
}

.header-label { 
    font-size: 12px; 
    color: var(--text-secondary); 
    margin-bottom: 4px; 
}

.header-value { 
    font-weight: 600; 
    font-size: 14px; 
}

.header-value.green { 
    color: var(--green);
}

#tradingview-chart-widget-container { 
    min-height: 450px; 
}

#tradingview-chart-widget-container iframe { 
    display: block; 
    height: 100%; 
    width: 100%; 
    border-radius: 8px; 
}

/* --- Right Sidebar & Accordions --- */
.right-sidebar { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    min-width: 0; 
}

.widget-box { 
    background-color: var(--bg-dark-secondary); 
    border-radius: 8px; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

.widget-header { 
    background: none; 
    border: none; 
    width: 100%; 
    padding: 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: var(--text-primary); 
    cursor: pointer; 
}

.widget-header h3 { 
    margin: 0; 
    font-size: 14px; 
    font-weight: 600; 
}

.header-controls { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.header-controls i { 
    transition: transform 0.3s ease; 
}

.accordion.active .header-controls i { 
    transform: rotate(180deg); 
}

.accordion-content { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.4s ease-in-out; 
}

.table-wrapper { 
    overflow-x: auto; 
}

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

thead th { 
    text-align: left; 
    color: var(--text-secondary); 
    font-weight: 500; 
    padding: 8px 12px; 
    font-size: 12px; 
    background-color: #2c2c2e; 
}

.bids-table thead { 
    border-top: 1px solid var(--border-color); 
}

tbody td { 
    padding: 6px 12px; 
    vertical-align: middle; 
    font-size: 13px; 
    border-bottom: 1px solid var(--border-color); 
}

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

tr { 
    position: relative; 
}

td { 
    background: transparent; 
    position: relative; 
    z-index: 1;
}

.exchange-logo { 
    width: 16px; 
    height: 16px; 
    margin-right: 8px; 
    vertical-align: middle; 
}


/* --- Trade Interface --- */
.trade-interface-container { 
    background-color: #1A1A1A; 
    border-radius: 12px; 
    padding: 8px; 
}

.trade-tabs { 
    display: flex; 
    margin-bottom: 8px; 
}
.tab-btn { 
    background: none; 
    border: none; 
    color: var(--text-secondary); 
    font: inherit; 
    font-weight: 500; 
    padding: 10px 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    flex: 1; 
    text-align: center; 
}

.tab-btn.active { 
    background-color: #2D2D2D; 
    color: var(--green); 
}

.trade-panels { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 16px; 
}

.trade-panel { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    background-color: var(--bg-dark-secondary); 
    padding: 16px; 
    border-radius: 8px; 
}

.trade-controls { 
    display: flex; 
    gap: 16px; 
}

.control-group { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.control-group label { 
    font-size: 12px; 
    color: var(--text-secondary); 
}

.dropdown-box { 
    background-color: #0E0E0E; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    padding: 10px 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: pointer; 
    font-size: 14px;
}

.input-box { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    padding: 10px 12px; 
    background-color: #0E0E0E; 
}

.input-box label { 
    font-size: 12px; 
    color: var(--text-secondary); 
}

.input-field { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
}

.input-field span:first-child { 
    font-weight: 500; 
    font-size: 14px; 
}

.input-field span:last-child { 
    color: var(--text-secondary); 
    cursor: pointer; 
}

.slider-track { 
    height: 4px; 
    background: #444; 
    border-radius: 2px; 
    position: relative; 
    margin-top: 8px; 
}

.slider-thumb { 
    width: 18px; 
    height: 18px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: absolute; 
    top: -7px; 
    transform: translateX(-50%) rotate(45deg); 
    cursor: pointer; 
}

.slider-thumb i { 
    transform: rotate(-45deg); 
    font-size: 10px; 
}

.slider-thumb.buy { 
    background: var(--green); 
    color: #000; 
}

.slider-thumb.sell { 
    background: var(--red); 
    color: #fff; 
}

.slider-percents { 
    display: flex; 
    justify-content: space-between; 
    font-size: 12px; 
    color: var(--text-secondary); 
    padding: 8px 0; 
}

.btn { 
    width: 100%; 
    padding: 12px; 
    border: none; 
    border-radius: 12px; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 4px; 
    font-size: 16px; 
    font-weight: 600; 
}

.btn-subtext { 
    font-weight: 400; 
    font-size: 12px; 
    display: flex; 
    align-items: center;
    gap: 6px; 
}

.btn-subtext img { 
    width: 16px; 
    height: 16px; 
    border-radius: 50%; 
    background: white; 
    padding: 1px; 
    scale: 1.3
}

.btn-buy { 
    background-color: var(--green); 
    color: #000; 
}

.btn-sell { 
    background-color: var(--red); 
    color: var(--text-primary); 
}


/* --- History Section --- */
.history-container-wrapper { 
    background-color: var(--bg-dark-secondary); 
}

.history-container { 
    max-width: 100%; 
    margin: 0 auto; 
    padding: 16px; 
    background-color: var(--bg-widget); 
    border-radius: 12px;
}

.footer-tabs { 
    display: flex; 
    justify-content: space-evenly; 
    gap: 24px; 
    margin-bottom: 16px; 
}

.footer-tab-btn { 
    background: none; 
    border: none; 
    color: var(--text-secondary); 
    font-size: 14px; 
    font-weight: 600; 
    cursor: pointer; 
    padding-bottom: 8px; 
    border-bottom: 2px solid transparent; 
}

.footer-tab-btn.active { 
    color: var(--green); 
    border-bottom-color: var(--green);
}

.footer-content { 
    display: none; 
}

.footer-content.active { 
    display: block; 
}

.history-toolbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 4px 0; 
    margin-bottom: 8px; 
}

.pagination { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
    padding: 8px 0; 
    font-size: 12px; 
    color: var(--text-secondary); 
}

.page-nav { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
}

.nav-arrow { 
    background: var(--bg-dark-secondary); 
    border: 1px solid var(--border-color); 
    color: var(--text-secondary); 
    width: 28px; 
    height: 28px; 
    border-radius: 4px; 
    cursor: pointer; 
}

.nav-arrow.active { 
    background-color: var(--green); 
    color: #000; 
}

.side-buy { 
    color: var(--green); 
}

.side-sell { 
    color: var(--red); 
}

.login-btn { 
    width: 100%; 
    padding: 10px; 
    background: #362F24; 
    color: #E5B969; 
    border: 1px solid #E5B969; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 14px; 
}


/* --- Responsiveness --- */
@media (max-width: 1200px) { 
    .main-area { 
        grid-template-columns: 1fr; 
    }
}

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

    .left-sidebar, .header { 
        flex-wrap: wrap; 
    }

    .main-content-wrapper { 
        grid-template-rows: 1fr; 
    }

    .main-area, .history-container-wrapper {
         padding: 8px; 
    }

    .trade-panels { 
        grid-template-columns: 1fr; 
    }

    .left-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 18px;
        .main-nav {
            flex-direction: row;
        }
    }
    .main-area > :first-child {
        order: 2;
    }

    .main-area > :last-child {
        order: 1;
    }

    .header-actions {
        background-color: transparent;
        justify-content: flex-end;
        width: 100%;
        flex-wrap: wrap;
    }

    .logo img {
        height: 75px;
    }

    .mob-hid {
        display: none;
    }

    .m-aw {
        background: transparent;
        color: var(--green);
    }

    body {
        padding-bottom: 100px;
    }
}