/*
 * Community Cat Calculator
 * Layout-only stylesheet. Fonts, colors, and element styles
 * are intentionally inherited from your active theme.
 */

/* ── Outer wrapper ───────────────────────────────────────── */
.ccc-wrapper {
    width: 100%;
    max-width: 820px;
}

.ccc-wrapper *,
.ccc-wrapper *::before,
.ccc-wrapper *::after {
    box-sizing: border-box;
}

/* ── Instructions ────────────────────────────────────────── */
.ccc-instructions {
    margin-bottom: 1.5em;
}

/* ── Primary inputs ──────────────────────────────────────── */
.ccc-primary-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1.5em;
}

.ccc-primary-inputs .ccc-field {
    flex: 1 1 240px;
    min-width: 0;
}

/* ── Fields ──────────────────────────────────────────────── */
.ccc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.75em;
}

.ccc-field label {
    font-weight: 600;
}

.ccc-field input[type="text"],
.ccc-field input[type="number"],
.ccc-field input[type="email"] {
    width: 100%;
    min-width: 0;
}

/* Description sits between label and input */
.ccc-desc {
    font-size: 0.8em;
    opacity: 0.7;
    margin-bottom: 2px;
}

/* ── Percentage input wrapper ────────────────────────────── */
.ccc-pct-wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px;
}

.ccc-pct-wrap input[type="number"] {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0;
    max-width: calc(100% - 2em);
}

.ccc-pct-label {
    font-weight: 600;
    flex-shrink: 0 !important;
    width: auto !important;
}

/* ── Variables accordion ─────────────────────────────────── */
.ccc-variables {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1.5em;
}

.ccc-variables summary {
    cursor: pointer;
    padding: 0.75em 1em;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

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

.ccc-variables summary::before {
    content: '\25b6\00a0';
    font-size: 0.75em;
}

.ccc-variables[open] summary::before {
    content: '\25bc\00a0';
}

.ccc-hint {
    font-weight: 400;
    font-size: 0.85em;
    opacity: 0.7;
}

.ccc-variables-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    padding: 1em 1em 1.25em;
    border-top: 1px solid #eee;
}

.ccc-var-group {
    flex: 1 1 220px;
    min-width: 0;
}

.ccc-var-group h3 {
    margin: 0 0 0.75em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eee;
    font-size: 1em;
}

/* ── Results ─────────────────────────────────────────────── */
.ccc-results {
    margin-bottom: 1.5em;
}

/* Keep BeTheme from making the h2 enormous */
.ccc-results h2 {
    font-size: 1.4em;
    margin-bottom: 0.75em;
}

.ccc-results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 0.75em;
}

.ccc-result-card {
    flex: 1 1 260px;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1em 1.25em;
}

.ccc-result-card h3 {
    margin: 0 0 0.75em;
    font-size: 1em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid;
}

/* ── Stat rows ───────────────────────────────────────────── */
.ccc-stat {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5em;
    padding: 0.35em 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}

.ccc-stat:last-child {
    border-bottom: none;
}

.ccc-stat-label {
    flex: 1 1 auto;
    min-width: 0;
}

.ccc-stat-value {
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.ccc-stat.ccc-highlight {
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.04);
    margin: 0.5em -0.5em -0.25em;
    padding: 0.5em;
    border-radius: 4px;
    border-bottom: none;
    font-size: 0.95em;
}

.ccc-stat.ccc-highlight .ccc-stat-label {
    line-height: 1.4;
}

.ccc-disclaimer {
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.75;
    margin-top: 0.75em;
}

/* ── Save / Share section ────────────────────────────────── */
.ccc-save-section {
    border-top: 1px solid #ddd;
    padding-top: 1.25em;
    margin-top: 0.5em;
}

/* Two options stacked vertically, consistent spacing */
.ccc-save-option {
    margin-bottom: 1.5em;
}

.ccc-save-option p {
    margin: 0 0 0.6em;
    font-size: 0.9em;
}

/* Space between CSV button and the email option below it */
.ccc-save-option:first-child {
    padding-bottom: 1.5em;
    border-bottom: 1px solid #eee;
}

/* Email field full width, button below it */
.ccc-email-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5em;
}

.ccc-email-row input[type="email"] {
    width: 100%;
    min-width: 0;
}

.ccc-email-status {
    margin-top: 0.25em;
    font-size: 0.9em;
    min-height: 1.4em;
    width: 100%;
}

.ccc-email-status.ccc-success { color: green; }
.ccc-email-status.ccc-error   { color: #c0392b; }
