/*
 *  style.css
 *  CDS Pricer — clean, conventional, light theme
 */

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

/* ---- reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---- base ---- */
html, body {
    height: 100%;
    background: #ffffff;
    color: #333333;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---- header ---- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.header h1 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #222222;
}

.header .tag {
    font-size: 10px;
    color: #999;
    letter-spacing: 1px;
}

/* ---- layout ---- */
.main {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 45px);
}

/* ---- left panel ---- */
.panel-left {
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    background: #fafafa;
}

.section-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e8e8e8;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
}

.field label .hint {
    font-size: 10px;
    color: #aaa;
    font-weight: 400;
}

.field input,
.field select {
    width: 100%;
    padding: 7px 10px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    color: #333;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.field select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.field input:focus,
.field select:focus {
    border-color: #666;
}

.field input::placeholder {
    color: #bbb;
}

/* ---- button ---- */
.btn-price {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    margin-bottom: 20px;
    background: #333333;
    border: 1px solid #333333;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-price:hover {
    background: #555555;
    border-color: #555555;
}

.btn-price:active {
    background: #222222;
}

/* ---- results panel ---- */
.results {
    border: 1px solid #e0e0e0;
    padding: 14px;
    background: #ffffff;
}

.results.flash {
    border-color: #333;
    transition: border-color 0.3s;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row .label {
    color: #888;
    font-size: 11px;
}

.result-row .value {
    color: #222222;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.result-row--highlight {
    background: #f6f6f6;
    margin: 2px -14px;
    padding: 5px 14px;
}

.result-row--highlight .label {
    color: #555;
    font-weight: 600;
}

.result-row--highlight .value {
    font-size: 13px;
}

/* ---- right panel (charts) ---- */
.panel-right {
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
}

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

.chart-box {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 12px;
    min-height: 220px;
    position: relative;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ---- scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f5f5f5;
}
::-webkit-scrollbar-thumb {
    background: #ccc;
}

/* ---- responsive ---- */
@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
        height: auto;
    }
    .panel-left {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .panel-right {
        min-height: 80vh;
    }
}
