/* ============================================================
   ND Filter Calculator — calculator.css  v1.1
   Styl dopasowany do inContact / wp-dof (jasny motyw)
   ============================================================ */

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

/* ─── Tokeny (spójne z inContact i wp-dof) ──────────── */
.nd-calc-wrapper {
    --blue: #2563eb;
    --blue-hover: #1a4fc4;
    --blue-light: rgba(37, 99, 235, 0.06);
    --blue-mid: rgba(37, 99, 235, 0.18);
    --blue-border: #93c5fd;
    --text: #1a1d26;
    --text-muted: #8a909e;
    --text-label: #8a909e;
    --bg: #ffffff;
    --bg-sidebar: #f8f8f8;
    --bg-result: rgba(37, 99, 235, 0.04);
    --border: #dde0e8;
    --border-input: #dde0e8;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.07);

    font-family: inherit;
    font-size: 16px;
    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 ─────────────────────────────────────────── */
.nd-calc-header {
    padding: 18px 28px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sidebar);
}

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

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

.nd-calc-tagline {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

/* ─── Body ───────────────────────────────────────────── */
.nd-calc-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    align-items: stretch;
}

/* ─── Left sidebar ───────────────────────────────────── */
.nd-calc-left {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 20px 28px;
}

.nd-calc-card {
    margin-bottom: 24px;
}

.nd-calc-card:last-child {
    margin-bottom: 0;
}

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

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

/* Step badge — dopasowany do inContact */
.nd-step-badge {
    width: 22px;
    height: 22px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ─── Labels ─────────────────────────────────────────── */
.nd-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
}

/* ─── Inputs ─────────────────────────────────────────── */
.nd-input {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    padding: 11px 14px;
    width: 100%;
    outline: none;
    transition:
        border-color 200ms ease,
        box-shadow 200ms ease;
    -webkit-appearance: none;
    appearance: none;
}

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

.nd-input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.nd-input-sm {
    width: 110px;
}

.nd-input-group {
    display: flex;
    margin-bottom: 10px;
}

.nd-input-group .nd-input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.nd-input-btn {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    padding: 0 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition:
        color 200ms ease,
        background 200ms ease;
}

.nd-input-btn:hover {
    color: var(--blue);
    background: var(--blue-light);
}

/* ─── Dial (hidden) ──────────────────────────────────── */
.nd-dial-container {
    display: none;
}
.nd-base-controls {
    display: block;
}
.nd-base-right {
    width: 100%;
}

/* ─── Shutter presets ────────────────────────────────── */
.nd-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.nd-preset {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    padding: 5px 9px;
    cursor: pointer;
    transition: all 150ms ease;
}

.nd-preset:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
}

.nd-preset.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    font-weight: 600;
}

/* ─── ND Filter grid ─────────────────────────────────── */
.nd-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.nd-filter-btn {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    padding: 9px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 150ms ease;
    box-shadow: var(--shadow);
}

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

.nd-filter-btn.active {
    background: var(--blue);
    border-color: var(--blue);
}

.nd-filter-stops {
    font-size: 11px;
    color: var(--text-muted);
}

.nd-filter-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.nd-filter-btn.active .nd-filter-stops {
    color: rgba(255, 255, 255, 0.7);
}
.nd-filter-btn.active .nd-filter-name {
    color: #fff;
}

/* ─── Custom stops ───────────────────────────────────── */
.nd-custom-stops {
    margin-top: 4px;
}

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

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

/* ─── Right panel ────────────────────────────────────── */
.nd-calc-right {
    padding: 24px 22px 20px;
    background: var(--bg);
}

/* ─── Result card ────────────────────────────────────── */
.nd-result-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 20px 16px;
    margin-bottom: 14px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 200ms ease;
}

.nd-result-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.nd-result-value-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
}

.nd-result-value {
    font-size: 60px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.03em;
}

.nd-result-unit {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-muted);
}

.nd-result-fraction {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ─── Timer button — identyczny z #ic-submit ─────────── */
.nd-timer-btn {
    width: 100%;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition:
        background 200ms ease,
        transform 200ms ease,
        box-shadow 200ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.nd-timer-btn:hover {
    background: var(--blue-hover);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.nd-timer-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.nd-timer-btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

/* ─── Timer display ──────────────────────────────────── */
.nd-timer-display {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.nd-timer-ring-wrap {
    position: relative;
    width: 110px;
    height: 110px;
}

.nd-timer-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}

.nd-timer-stop {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease;
    box-shadow: var(--shadow);
}

.nd-timer-stop:hover {
    background: var(--bg-sidebar);
}

/* ─── Timeline card ──────────────────────────────────── */
.nd-timeline-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.nd-card-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.nd-timeline {
    margin-bottom: 10px;
}

.nd-timeline-track {
    position: relative;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-bottom: 8px;
}

.nd-timeline-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #93c5fd, var(--blue));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 25%;
}

.nd-timeline-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--blue);
    border: 2.5px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--blue-border);
    transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    left: 25%;
    z-index: 2;
}

.nd-timeline-tooltip {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blue);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.nd-timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── Reciprocity ────────────────────────────────────── */
.nd-reciprocity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.nd-recip-label {
    color: var(--text-muted);
}

.nd-recip-value {
    color: #059669;
    font-weight: 600;
}

.nd-recip-value.nd-warning {
    color: #dc2626;
}

/* ─── Info card — identyczna z wp-dof-insight ────────── */
.nd-info-card {
    background: var(--bg-result);
    border: 1px solid var(--blue-mid);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.nd-info-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.nd-info-text strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.nd-info-text p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.6;
}

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

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

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

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

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