/* ND Filter Calculator – Jasny motyw (styl kalkulatora głębi ostrości) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* ─── Variables ─────────────────────────────────────── */
.nd-calc-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-result:   #F0F7FF;
    --border:      #E5E7EB;
    --border-input:#D1D5DB;
    --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 ─────────────────────────────────────────── */
.nd-calc-header {
    padding: 18px 28px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

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

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

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

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

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

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

.nd-calc-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 24px;
    box-shadow: none;
}

.nd-calc-card:last-child { margin-bottom: 0; }
.nd-calc-card:hover { border-color: transparent; }

.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);
}

.nd-step-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;
}

/* ─── Labels & Inputs ────────────────────────────────── */
.nd-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-label);
    margin-bottom: 5px;
    text-transform: none;
    letter-spacing: 0;
}

.nd-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: 9px 11px;
    width: 100%;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow);
}

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

.nd-input-sm {
    width: 110px;
    border-radius: var(--radius-sm);
}

.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: 9px 11px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

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

/* ─── Dial (hidden on light) ──────────────────────────── */
.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 0.12s;
}

.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: 500;
}

/* ─── 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 0.12s;
    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: 10px;
    color: var(--text-muted);
}

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

.nd-filter-btn.active .nd-filter-stops { color: rgba(255,255,255,0.75); }
.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);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 20px 16px;
    margin-bottom: 14px;
    text-align: center;
    box-shadow: var(--shadow);
}

.nd-result-label {
    font-size: 11px;
    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 ───────────────────────────────────── */
.nd-timer-btn {
    width: 100%;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(37,99,235,0.25);
}

.nd-timer-btn:hover { background: var(--blue-hover); }
.nd-timer-btn:active { transform: scale(0.98); }

/* ─── 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 0.12s;
    box-shadow: var(--shadow);
}

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

/* ─── Timeline card ──────────────────────────────────── */
.nd-timeline-card {
    background: var(--bg);
    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: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}

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

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

.nd-timeline-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--blue-mid), 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: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(37,99,235,0.25);
}

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

.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: 500;
}

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

/* ─── Info card ──────────────────────────────────────── */
.nd-info-card {
    background: var(--bg-result);
    border: 1px solid var(--blue-mid);
    border-radius: var(--radius);
    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: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.nd-info-text p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    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: #fff;
    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: 500;
}

/* ─── Dark theme (opt-in via theme="dark") ───────────── */
.nd-theme-dark {
    --blue:        #F5C518;
    --blue-hover:  #c9a010;
    --blue-light:  rgba(245,197,24,0.1);
    --blue-mid:    rgba(245,197,24,0.25);
    --blue-border: rgba(245,197,24,0.4);
    --text:        #e8e0c8;
    --text-muted:  #8a8070;
    --text-label:  #c8bfa0;
    --bg:          #1d1b0f;
    --bg-sidebar:  #141209;
    --bg-result:   rgba(245,197,24,0.06);
    --border:      rgba(245,197,24,0.12);
    --border-input:#3a3520;
    --shadow:      0 1px 3px rgba(0,0,0,0.5);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.6);
}

.nd-theme-dark .nd-step-badge { background: var(--blue); color: #0d0c00; }
.nd-theme-dark .nd-preset.active { background: var(--blue); color: #0d0c00; border-color: var(--blue); }
.nd-theme-dark .nd-filter-btn.active { background: var(--blue-light); border-color: var(--blue); }
.nd-theme-dark .nd-filter-btn.active .nd-filter-name { color: var(--blue); }
.nd-theme-dark .nd-filter-btn.active .nd-filter-stops { color: rgba(245,197,24,0.6); }
.nd-theme-dark .nd-timer-btn { color: #0d0c00; box-shadow: none; }
.nd-theme-dark .nd-timer-count { color: var(--text); }
.nd-theme-dark .nd-timeline-thumb { background: var(--blue); border-color: var(--bg); }
.nd-theme-dark .nd-timeline-tooltip { background: var(--bg-sidebar); border: 1px solid var(--blue); color: var(--blue); box-shadow: none; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 700px) {
    .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; }
}
