/* ============================================
   BINARY TO OCTAL CONVERTER - CSS
   Version 1.0
============================================ */

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

.b2oc-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

.b2oc-wrap {
    --blue:        #0D9488;
    --darkblue:    #0F2A3D;
    --cyan:        #14B8A6;
    --amber:       #E8A33D;
    --grad:        linear-gradient(135deg, #0D9488 0%, #0F2A3D 100%);
    --grad-soft:   linear-gradient(135deg, rgba(13,148,136,0.08) 0%, rgba(15,42,61,0.08) 100%);
    --white:       #FFFFFF;
    --bg:          #F2F7F6;
    --card-bg:     #FFFFFF;
    --border:      rgba(13,148,136,0.14);
    --text:        #0F2A3D;
    --text-muted:  #5C7A80;
    --shadow-card: 0 32px 80px rgba(15,42,61,0.16), 0 8px 24px rgba(13,148,136,0.10);
    --shadow-btn:  0 12px 32px rgba(13,148,136,0.40);
    --radius-xl:   24px;
    --radius-lg:   16px;
    --radius-md:   12px;
    --radius-sm:   8px;
    font-family: 'Inter', sans-serif;
    position: relative;
    padding: 40px 16px;
    background: var(--bg);
    min-height: 100%;
}

.b2oc-blob { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; z-index: 0; }
.b2oc-blob-1 { width: 300px; height: 300px; background: rgba(13,148,136,0.14); top: -60px; left: -80px; }
.b2oc-blob-2 { width: 250px; height: 250px; background: rgba(15,42,61,0.10); bottom: 40px; right: -60px; }

.b2oc-card {
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* ---- Header ---- */
.b2oc-header { background: var(--grad); padding: 28px 30px; display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden; }
.b2oc-header::after { content: ''; position: absolute; width: 200px; height: 200px; background: rgba(255,255,255,0.06); border-radius: 50%; top: -80px; right: -60px; }
.b2oc-header::before { content: ''; position: absolute; width: 120px; height: 120px; background: rgba(255,255,255,0.04); border-radius: 50%; bottom: -40px; left: 30%; }
.b2oc-header-icon { width: 52px; height: 52px; background: rgba(255,255,255,0.18); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.25); }
.b2oc-header-icon svg { width: 28px; height: 28px; }
.b2oc-header-text { flex: 1; min-width: 0; }
.b2oc-header-text h2 { color: #FFFFFF; font-size: 17px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.25; }
.b2oc-header-text p { color: rgba(255,255,255,0.75); font-size: 12px; font-weight: 400; margin-top: 3px; }

.b2oc-history-btn { width: 40px; height: 40px; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; position: relative; z-index: 2; transition: background 0.2s; }
.b2oc-history-btn:hover { background: rgba(255,255,255,0.28); }

/* ---- History Panel ---- */
.b2oc-history-panel { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; background: #FAFBFF; border-bottom: 1px solid var(--border); }
.b2oc-history-panel.b2oc-history-open { max-height: 320px; overflow-y: auto; }
.b2oc-history-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.b2oc-history-clear { background: none; border: none; color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; }
.b2oc-history-list { padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.b2oc-history-empty { font-size: 13px; color: var(--text-muted); padding: 12px 0; text-align: center; }
.b2oc-history-item { background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.b2oc-history-item-score { font-size: 12.5px; font-weight: 700; color: var(--text); }
.b2oc-history-item-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- Explainer ---- */
.b2oc-explainer { border-bottom: 1px solid var(--border); }
.b2oc-explainer-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 16px 30px; background: var(--grad-soft); border: none; cursor: pointer;
    font-size: 13.5px; font-weight: 700; color: var(--text); font-family: 'Inter', sans-serif;
}
.b2oc-explainer-toggle svg { color: var(--blue); transition: transform 0.25s ease; flex-shrink: 0; }
#b2oc_explainer_arrow.b2oc-explainer-arrow-open { transform: rotate(180deg); }
.b2oc-explainer-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; padding: 0 30px; }
.b2oc-explainer-body.b2oc-explainer-open { max-height: 320px; padding: 16px 30px; }
.b2oc-explainer-body p { font-size: 12.5px; color: var(--text-muted); line-height: 1.65; margin-bottom: 10px; }
.b2oc-explainer-body p:last-child { margin-bottom: 0; }
.b2oc-explainer-body strong { color: var(--text); }

/* ---- Body ---- */
.b2oc-body { padding: 24px 30px 28px; display: flex; flex-direction: column; gap: 16px; }
.b2oc-step-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.b2oc-step-label span { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: 0.1px; }

.b2oc-plain-input {
    width: 100%; padding: 14px 16px;
    border: 2px solid var(--border); border-radius: var(--radius-md);
    font-size: 15px; font-family: 'Inter', sans-serif; font-weight: 600;
    color: var(--text); background: #FAFBFF; outline: none;
    transition: all 0.25s ease;
}
.b2oc-plain-input:focus { border-color: var(--blue); background: white; box-shadow: 0 0 0 4px rgba(13,148,136,0.08); }

/* ---- Result Section ---- */
.b2oc-result {
    display: none;
    border-top: 1px solid var(--border);
    padding: 28px 30px;
    background: linear-gradient(180deg, rgba(13,148,136,0.02) 0%, rgba(15,42,61,0.03) 100%);
}
.b2oc-result-visible { display: block; }
.b2oc-result-header { display: flex; justify-content: center; margin-bottom: 20px; }
.b2oc-result-badge { background: var(--grad); color: white; padding: 6px 18px; border-radius: 100px; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; box-shadow: 0 4px 14px rgba(13,148,136,0.30); }

.b2oc-due-card {
    background: var(--grad); border-radius: var(--radius-lg); padding: 24px;
    text-align: center; margin-bottom: 20px; position: relative; overflow: hidden;
    box-shadow: 0 16px 40px rgba(13,148,136,0.25);
}
.b2oc-due-card::before { content: ''; position: absolute; width: 150px; height: 150px; background: rgba(255,255,255,0.07); border-radius: 50%; top: -50px; right: -30px; }
.b2oc-due-card::after { content: ''; position: absolute; width: 100px; height: 100px; background: rgba(255,255,255,0.05); border-radius: 50%; bottom: -30px; left: -20px; }
.b2oc-due-label { color: rgba(255,255,255,0.80); font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 10px; }
.b2oc-due-date { color: white; font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.b2oc-due-sub { color: rgba(255,255,255,0.85); font-size: 12.5px; font-weight: 500; }

/* Formula Breakdown */
.b2oc-breakdown-card { background: white; border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 20px; }
.b2oc-breakdown-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; }
.b2oc-breakdown-list { display: flex; flex-direction: column; }
.b2oc-breakdown-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 12px; align-items: center; }
.b2oc-breakdown-row:first-child { border-top: none; padding-top: 0; }
.b2oc-breakdown-key { color: var(--text-muted); font-weight: 500; flex-shrink: 0; }
.b2oc-breakdown-val { color: var(--text); font-weight: 700; text-align: right; }

/* Save Button */
.b2oc-save-btn {
    width: 100%; padding: 12px 16px;
    background: white; border: 1.5px dashed var(--blue); border-radius: var(--radius-md);
    color: var(--blue); font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif;
    cursor: pointer; margin-bottom: 16px;
    transition: all 0.25s ease;
}
.b2oc-save-btn:hover { background: var(--grad-soft); }

/* Export Buttons */
.b2oc-export-row { display: flex; gap: 12px; }
.b2oc-export-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 14px; background: white; border: 1.5px solid var(--border); border-radius: var(--radius-md);
    font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif;
    color: var(--blue); cursor: pointer;
    transition: all 0.25s ease;
}
.b2oc-export-btn:hover { border-color: var(--blue); background: var(--grad-soft); transform: translateY(-1px); }
.b2oc-export-btn svg { flex-shrink: 0; }

/* ---- Footer ---- */
.b2oc-footer { display: flex; align-items: flex-start; gap: 8px; padding: 16px 30px 24px; font-size: 10.5px; color: var(--text-muted); line-height: 1.6; border-top: 1px solid var(--border); background: #FAFBFF; }
.b2oc-footer svg { flex-shrink: 0; margin-top: 2px; color: var(--blue); }

/* ---- Mobile ---- */
@media (max-width: 580px) {
    .b2oc-wrap { padding: 20px 10px; }
    .b2oc-card { border-radius: var(--radius-lg); }
    .b2oc-header { padding: 22px 20px; }
    .b2oc-explainer-toggle { padding: 14px 20px; font-size: 12.5px; }
    .b2oc-explainer-body { padding-left: 20px; padding-right: 20px; }
    .b2oc-explainer-body.b2oc-explainer-open { padding: 16px 20px; }
    .b2oc-body { padding: 20px 20px 22px; gap: 18px; }
    .b2oc-result { padding: 22px 20px; }
    .b2oc-footer { padding: 14px 20px 20px; }
    .b2oc-due-date { font-size: 26px; }
    .b2oc-header-text h2 { font-size: 15px; }
    .b2oc-export-row { flex-direction: column; }
    .b2oc-breakdown-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .b2oc-breakdown-val { text-align: left; }
}
