/* Flicker-Free Calculator – WordPress Plugin Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Reset ─────────────────────────────────────────── */
.ffc-wrapper *, .ffc-wrapper *::before, .ffc-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Variables ─────────────────────────────────────── */
.ffc-wrapper {
    --blue:        #2563EB;
    --blue-hover:  #1D4ED8;
    --blue-light:  #EFF6FF;
    --blue-mid:    #BFDBFE;
    --blue-border: #93C5FD;
    --text:        #111827;
    --text-muted:  #6B7280;
    --text-label:  #374151;
    --bg:          #FFFFFF;
    --bg-sidebar:  #F9FAFB;
    --bg-info:     #F0F7FF;
    --border:      #E5E7EB;
    --border-input:#D1D5DB;
    --green:       #059669;
    --red:         #DC2626;
    --orange:      #D97706;
    --radius:      8px;
    --radius-sm:   6px;
    --shadow:      0 1px 3px rgba(0,0,0,0.08);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.07);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    max-width: 1060px;
    margin: 0 auto;
}

/* ─── Header ─────────────────────────────────────────── */
.ffc-header {
    padding: 18px 28px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.ffc-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.ffc-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.ffc-tagline {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

/* ─── Body Layout ────────────────────────────────────── */
.ffc-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    align-items: start;
}

@media (max-width: 750px) {
    .ffc-body { grid-template-columns: 1fr; }
}

/* ─── Left Sidebar ───────────────────────────────────── */
.ffc-left {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 20px 28px;
    min-height: 540px;
}

.ffc-section {
    margin-bottom: 26px;
}

.ffc-section:last-child { margin-bottom: 0; }

.ffc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.ffc-section-title h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.ffc-badge {
    width: 24px;
    height: 24px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.ffc-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-label);
    margin-bottom: 8px;
}

/* ─── Hz Grid ────────────────────────────────────────── */
.ffc-hz-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.ffc-hz-btn {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: all 0.12s;
    box-shadow: var(--shadow);
}

.ffc-hz-btn:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}

.ffc-hz-btn.active {
    background: var(--blue);
    border-color: var(--blue);
}

.ffc-hz-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.ffc-hz-region {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}

.ffc-hz-btn.active .ffc-hz-value  { color: #fff; }
.ffc-hz-btn.active .ffc-hz-region { color: rgba(255,255,255,0.75); }

/* ─── Hz Note ────────────────────────────────────────── */
.ffc-hz-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    background: var(--bg-info);
    border: 1px solid var(--blue-mid);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.ffc-hz-note svg { flex-shrink: 0; margin-top: 1px; }

/* ─── FPS Grid ───────────────────────────────────────── */
.ffc-fps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.ffc-fps-btn {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 4px;
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: var(--shadow);
    text-align: center;
}

.ffc-fps-btn:hover {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

.ffc-fps-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

/* ─── Custom FPS ─────────────────────────────────────── */
.ffc-custom-fps { margin-top: 4px; }

.ffc-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ffc-input {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 8px 11px;
    width: 130px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow);
}

.ffc-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.ffc-unit {
    font-size: 13px;
    color: var(--text-muted);
}

/* ─── Right Panel ────────────────────────────────────── */
.ffc-right {
    padding: 20px 22px 20px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ─── Result Cards ───────────────────────────────────── */
.ffc-result-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.ffc-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.ffc-result-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* ─── Speed / Angle Lists ────────────────────────────── */
.ffc-speeds-list,
.ffc-angles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.ffc-speed-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--blue-light);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: default;
    transition: background 0.12s;
    min-width: 80px;
}

.ffc-speed-chip.ffc-chip-primary {
    background: var(--blue);
    border-color: var(--blue);
}

.ffc-speed-chip.ffc-chip-primary .ffc-chip-val  { color: #fff; }
.ffc-speed-chip.ffc-chip-primary .ffc-chip-note { color: rgba(255,255,255,0.75); }

.ffc-chip-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: -0.02em;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.ffc-chip-note {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.ffc-angle-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--blue-light);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    min-width: 80px;
}

.ffc-angle-chip.ffc-chip-primary {
    background: var(--blue);
    border-color: var(--blue);
}

.ffc-angle-chip.ffc-chip-primary .ffc-chip-val  { color: #fff; }
.ffc-angle-chip.ffc-chip-primary .ffc-chip-note { color: rgba(255,255,255,0.75); }

.ffc-chip-rule {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    background: rgba(37,99,235,0.15);
    color: var(--blue);
    border-radius: 3px;
    padding: 1px 4px;
    font-weight: 600;
    vertical-align: middle;
}

.ffc-chip-primary .ffc-chip-rule {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.ffc-result-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── Visual / Dial Card ─────────────────────────────── */
.ffc-visual-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.ffc-visual-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}

.ffc-dial-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ffc-dial-wrap {
    position: relative;
    flex-shrink: 0;
}

.ffc-dial-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ffc-dial-deg {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}

.ffc-dial-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    text-align: center;
}

/* ─── Legend ─────────────────────────────────────────── */
.ffc-dial-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ffc-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.ffc-legend-rule { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); }

.ffc-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ffc-dot-blue { background: var(--blue); }
.ffc-dot-gray { background: #E5E7EB; border: 1px solid #D1D5DB; }

.ffc-180-indicator {
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: #ECFDF5;
    border: 1px solid #6EE7B7;
    color: var(--green);
    transition: all 0.2s;
}

.ffc-180-indicator.ffc-warn {
    background: #FEF3C7;
    border-color: #FCD34D;
    color: var(--orange);
}

/* ─── Info Card ──────────────────────────────────────── */
.ffc-info-card {
    background: var(--bg-info);
    border: 1px solid var(--blue-mid);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ffc-info-icon { flex-shrink: 0; margin-top: 1px; }

.ffc-info-card strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.ffc-info-card p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Formula Bar ────────────────────────────────────── */
.ffc-formula-bar {
    border-top: 1px solid var(--border);
    padding: 11px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-sidebar);
    flex-wrap: wrap;
    gap: 8px;
}

.ffc-formula-text {
    font-size: 12px;
    color: var(--text-muted);
}

.ffc-formula-text code {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--blue);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
}

.ffc-formula-current {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
    color: var(--blue);
    font-weight: 500;
}

/* ─── Empty state ────────────────────────────────────── */
.ffc-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 0;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 750px) {
    .ffc-body { grid-template-columns: 1fr; }
    .ffc-left { border-right: none; border-bottom: 1px solid var(--border); min-height: auto; }
    .ffc-dial-row { flex-direction: column; align-items: flex-start; }
    .ffc-formula-bar { flex-direction: column; align-items: flex-start; }
}
