/*
 * Ebced Hesapla – Frontend Stylesheet
 * Clean, responsive, mobile-first design.
 * No external fonts or icon libraries.
 */

/* ── Wrapper ──────────────────────────────────────────────────── */
.ebced-wrapper {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.6;
}

/* ── Disclaimer ───────────────────────────────────────────────── */
.ebced-disclaimer {
    background: #f5f0e8;
    border-left: 4px solid #b5862b;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13.5px;
    color: #5a4a1a;
    margin-bottom: 24px;
}

/* ── Section ──────────────────────────────────────────────────── */
.ebced-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Headings ─────────────────────────────────────────────────── */
.ebced-heading {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ebced-badge {
    background: #b5862b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.ebced-premium-note {
    font-size: 13.5px;
    color: #555;
    margin: -8px 0 18px;
}

/* ── Labels ───────────────────────────────────────────────────── */
.ebced-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.ebced-label-arabic {
    margin-top: 16px;
}

.ebced-hint {
    font-weight: 400;
    color: #777;
    font-size: 12px;
    display: block;
}

/* ── Inputs ───────────────────────────────────────────────────── */
.ebced-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
    color: #1a1a1a;
}

.ebced-input:focus {
    border-color: #2c6fad;
    box-shadow: 0 0 0 3px rgba(44,111,173,.15);
    background: #fff;
}

.ebced-input.ebced-arabic {
    font-size: 20px;
    letter-spacing: .06em;
    font-family: "Noto Naskh Arabic", "Scheherazade New", "Arabic Typesetting",
                 "Traditional Arabic", serif;
    direction: rtl;
    text-align: right;
}

/* ── Input row (input + button side by side) ──────────────────── */
.ebced-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.ebced-input-row .ebced-input {
    flex: 1;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.ebced-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, opacity .2s;
    line-height: 1.4;
}

.ebced-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.ebced-btn-primary {
    background: #2c6fad;
    color: #fff;
    margin-top: 18px;
    width: 100%;
}

.ebced-btn-primary:hover:not(:disabled) {
    background: #215a8e;
}

.ebced-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.ebced-btn-secondary:hover:not(:disabled) {
    background: #e2e2e2;
}

/* ── Premium actions ──────────────────────────────────────────── */
.ebced-premium-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.ebced-premium-actions .ebced-btn-primary {
    margin-top: 0;
    width: auto;
    flex: 1;
}

/* ── Variant rows ─────────────────────────────────────────────── */
.ebced-variant-row {
    margin-bottom: 12px;
}

/* ── Result area ──────────────────────────────────────────────── */
.ebced-result {
    margin-top: 8px;
}

.ebced-result[hidden] {
    display: none;
}

/* ── Loading / error ──────────────────────────────────────────── */
.ebced-loading {
    padding: 14px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.ebced-error {
    padding: 12px 16px;
    background: #fef3f2;
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
    color: #b71c1c;
    font-size: 14px;
}

/* ── Result card ──────────────────────────────────────────────── */
.ebced-card {
    background: #fff;
    border: 1px solid #d0e8ff;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ebced-premium-card {
    border-color: #e8d5a0;
}

.ebced-card-heading {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.ebced-name-display {
    font-family: "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", serif;
    font-size: 26px;
    text-align: right;
    direction: rtl;
    color: #1a1a1a;
    margin: 0 0 10px;
    letter-spacing: .05em;
}

.ebced-total {
    font-size: 17px;
    margin: 0 0 16px;
    color: #333;
}

.ebced-total strong {
    color: #2c6fad;
    font-size: 22px;
}

/* ── Table ────────────────────────────────────────────────────── */
.ebced-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ebced-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ebced-table th,
.ebced-table td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.ebced-table thead th {
    background: #f0f5fb;
    font-weight: 700;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ebced-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.ebced-table tfoot td {
    background: #f0f5fb;
    font-weight: 700;
}

.ebced-table .ebced-letter {
    font-family: "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", serif;
    font-size: 20px;
    direction: rtl;
    display: inline-block;
}

.ebced-table .ebced-value {
    color: #2c6fad;
    font-weight: 600;
}

/* Premium comparison table extras */
.ebced-compare-table .ebced-th-arabic {
    font-family: "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", serif;
    font-size: 18px;
}

.ebced-compare-table .ebced-total-cell {
    color: #2c6fad;
    font-size: 16px;
}

.ebced-compare-table .ebced-bold {
    font-weight: 700;
}

.ebced-compare-table .ebced-sub-val {
    font-size: 11px;
    color: #888;
}

.ebced-compare-table .ebced-row-num {
    color: #aaa;
    font-size: 12px;
}

/* ── Optional label tag ───────────────────────────────────────── */
.ebced-optional-tag {
    font-weight: 400;
    color: #888;
    font-size: 12px;
}

/* ── Date input ───────────────────────────────────────────────── */
.ebced-date-input {
    max-width: 220px;
}

/* ── Summary numbers row ──────────────────────────────────────── */
.ebced-numbers-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.ebced-number-box {
    flex: 1;
    min-width: 100px;
    background: #f0f5fb;
    border: 1px solid #d0e0f5;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}

.ebced-number-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #557;
    margin-bottom: 4px;
}

.ebced-number-val {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #2c6fad;
    line-height: 1.1;
}

.ebced-number-val.ebced-highlight {
    color: #1a6b3c;
}

/* ── Combination comment block ────────────────────────────────── */
.ebced-combo {
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 18px;
    border-left: 5px solid #aaa;
    background: #f8f8f8;
}

.ebced-combo--uyumlu {
    border-color: #2e7d32;
    background: #f1f8f2;
}

.ebced-combo--destekleyici {
    border-color: #1565c0;
    background: #f0f4fb;
}

.ebced-combo--zorlayici {
    border-color: #b71c1c;
    background: #fef5f5;
}

.ebced-combo-label {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 6px;
    color: #222;
}

.ebced-combo--uyumlu     .ebced-combo-label { color: #2e7d32; }
.ebced-combo--destekleyici .ebced-combo-label { color: #1565c0; }
.ebced-combo--zorlayici  .ebced-combo-label { color: #b71c1c; }

.ebced-combo-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: #444;
}

/* ── Collapsible letter table (details/summary) ───────────────── */
.ebced-details {
    margin-top: 4px;
}

.ebced-details summary {
    cursor: pointer;
    font-size: 13px;
    color: #2c6fad;
    font-weight: 600;
    padding: 6px 0;
    user-select: none;
    list-style: none;
}

.ebced-details summary::-webkit-details-marker { display: none; }

.ebced-details summary::before {
    content: '▶ ';
    font-size: 10px;
    vertical-align: middle;
}

.ebced-details[open] summary::before {
    content: '▼ ';
}

/* ── Responsive ───────────────────────────────────────────────── */
@media ( max-width: 480px ) {
    .ebced-numbers-row {
        gap: 8px;
    }

    .ebced-number-box {
        min-width: 80px;
    }

    .ebced-number-val {
        font-size: 22px;
    }

    .ebced-date-input {
        max-width: 100%;
    }
}
    .ebced-section {
        padding: 16px;
    }

    .ebced-input-row {
        flex-direction: column;
    }

    .ebced-btn-secondary {
        width: 100%;
    }

    .ebced-premium-actions {
        flex-direction: column;
    }

    .ebced-premium-actions .ebced-btn {
        width: 100%;
        flex: unset;
    }

    .ebced-table th,
    .ebced-table td {
        padding: 6px 8px;
        font-size: 13px;
    }
}
