/* ============================================================
   Gematria Calculator — WordPress Plugin Stylesheet
   Light theme, scoped to .gc-wrap
   ============================================================ */

.gc-wrap *,
.gc-wrap *::before,
.gc-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.gc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a2e;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 32px 48px;
    max-width: 960px;
    margin: 0 auto;
    box-shadow: 0 4px 32px rgba(0,0,0,0.06);
}

/* ── Header ────────────────────────────────────────────────── */
.gc-header {
    text-align: center;
    margin-bottom: 32px;
}

.gc-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.gc-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

/* ── Input ─────────────────────────────────────────────────── */
.gc-input-section {
    margin-bottom: 24px;
}

.gc-input-wrap {
    position: relative;
}

.gc-input {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 48px 16px 20px;
    font-size: 1.5rem;
    font-family: inherit;
    color: #1a1a2e;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.gc-input::placeholder {
    color: #94a3b8;
}

.gc-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
    background: #ffffff;
}

.gc-clear-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}

.gc-clear-btn:hover {
    color: #1a1a2e;
    background: #f1f5f9;
}

/* ── Meta row ──────────────────────────────────────────────── */
.gc-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 0 4px;
    font-size: 0.8rem;
    color: #64748b;
}

.gc-counts {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gc-sep {
    opacity: 0.4;
}

.gc-copy-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
}

.gc-copy-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1a1a2e;
}

.gc-copy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gc-copy-btn.gc-copied {
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
}

/* ── Suggestions ───────────────────────────────────────────── */
.gc-suggestions {
    margin-bottom: 28px;
    text-align: center;
}

.gc-suggestions-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    margin-bottom: 12px;
}

.gc-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.gc-chip {
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.85rem;
    font-family: inherit;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.gc-chip:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4f46e5;
}

/* ── Results grid ──────────────────────────────────────────── */
.gc-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

@media (min-width: 540px) {
    .gc-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .gc-results-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.gc-cipher-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 14px 14px;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 110px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.gc-cipher-card:hover {
    border-color: #a5b4fc;
    background: #fafafe;
    box-shadow: 0 4px 16px rgba(79,70,229,0.08);
}

.gc-cipher-card.gc-active {
    border-color: #4f46e5;
    background: #eef2ff;
    box-shadow: 0 4px 20px rgba(79,70,229,0.15);
}

.gc-cipher-name {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    line-height: 1.3;
    transition: color 0.2s;
}

.gc-cipher-card.gc-active .gc-cipher-name {
    color: #4f46e5;
}

.gc-cipher-total {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a1a2e !important;
    line-height: 1;
    margin-top: auto;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.gc-cipher-card.gc-active .gc-cipher-total {
    color: #4f46e5 !important;
}

/* flash animation when value changes */
@keyframes gc-flash {
    0%   { opacity: 0.4; transform: scale(1.08); }
    100% { opacity: 1;   transform: scale(1); }
}
.gc-flash {
    animation: gc-flash 0.35s ease-out;
}

/* ── Letter Breakdown ──────────────────────────────────────── */
.gc-breakdown {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 28px;
}

.gc-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.gc-breakdown-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gc-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4f46e5;
    animation: gc-pulse 1.8s infinite;
    flex-shrink: 0;
}

@keyframes gc-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.gc-breakdown-sum {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 16px;
}

.gc-breakdown-total {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
}

.gc-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.gc-letter-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.gc-letter-tile.gc-vowel {
    border-color: #a5b4fc;
    background: #eef2ff;
}

.gc-letter-char {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 8px 0 4px;
    color: #1a1a2e;
}

.gc-letter-tile.gc-vowel .gc-letter-char {
    color: #4f46e5;
}

.gc-letter-val {
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    padding: 4px 2px;
    background: #f1f5f9;
    color: #475569;
    font-variant-numeric: tabular-nums;
    border-top: 1px solid #e2e8f0;
}

.gc-letter-tile.gc-vowel .gc-letter-val {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #a5b4fc;
}

.gc-letter-space {
    width: 20px;
    flex-shrink: 0;
}

/* ── Reference Table ───────────────────────────────────────── */
.gc-reference {
    padding-top: 28px;
    border-top: 1px solid #e2e8f0;
}

.gc-reference-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    margin-bottom: 16px;
}

.gc-reference-cipher-name {
    color: #4f46e5;
}

.gc-reference-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

@media (min-width: 540px) {
    .gc-reference-grid {
        grid-template-columns: repeat(13, 1fr);
    }
}

.gc-ref-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: background 0.15s;
}

.gc-ref-cell:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
}

.gc-ref-letter {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
}

.gc-ref-val {
    font-size: 0.7rem;
    color: #1a1a2e;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

/* ── Toast notification ────────────────────────────────────── */
.gc-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: #1a1a2e;
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    z-index: 99999;
    white-space: nowrap;
}

.gc-toast.gc-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 480px) {
    .gc-wrap {
        padding: 24px 16px 32px;
        border-radius: 12px;
    }

    .gc-title {
        font-size: 1.5rem;
    }

    .gc-input {
        font-size: 1.1rem;
        padding: 14px 42px 14px 16px;
    }

    .gc-cipher-total {
        font-size: 1.8rem;
    }
}
