/* ═══════════════════════════════════════════════════════════════
   Nourlytics Sample Size Calculator — Stylesheet
   Brand palette: Navy #1A2B4A | Blue #1E6FA6 | Orange #E05A1C | Sky #4BADD4
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&display=swap');
/* ── Reset & Wrapper ─────────────────────────────────────────── */
.nsc-wrapper,
.nsc-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.nsc-wrapper {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    direction: ltr;
    text-align: left;
    max-width: 860px;
    margin: 3rem auto;
    padding: 0 1rem;
}
/* ── Main Card ───────────────────────────────────────────────── */
.nsc-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 48px 44px 44px;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 20px 60px rgba(26, 43, 74, 0.08),
        0 0 0 1px rgba(26, 43, 74, 0.06);
}
/* Decorative glow orbs */
.nsc-card::before,
.nsc-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
    opacity: 0.07;
}
.nsc-card::before {
    width: 300px;
    height: 300px;
    background: #4BADD4;
    top: -100px;
    right: -60px;
}
.nsc-card::after {
    width: 250px;
    height: 250px;
    background: #E05A1C;
    bottom: -80px;
    left: -40px;
}
/* ── Header ──────────────────────────────────────────────────── */
.nsc-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}
.nsc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 111, 166, 0.06);
    border: 1px solid rgba(30, 111, 166, 0.12);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1E6FA6;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}
.nsc-badge svg {
    width: 14px;
    height: 14px;
}
.nsc-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1A2B4A;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 8px;
}
.nsc-title span {
    background: linear-gradient(135deg, #1E6FA6, #4BADD4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nsc-subtitle {
    font-size: 0.92rem;
    color: #8A9BBF;
    font-weight: 400;
    line-height: 1.5;
}
/* ── Input Grid ──────────────────────────────────────────────── */
.nsc-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 36px;
    position: relative;
    z-index: 1;
}
/* ── Input Group ─────────────────────────────────────────────── */
.nsc-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nsc-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1A2B4A;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.nsc-info {
    position: relative;
    display: inline-flex;
    cursor: help;
}
.nsc-info-icon {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid rgba(26, 43, 74, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(26, 43, 74, 0.4);
    transition: all 0.2s ease;
    line-height: 1;
}
.nsc-info:hover .nsc-info-icon {
    border-color: #1E6FA6;
    color: #1E6FA6;
    background: rgba(30, 111, 166, 0.08);
}
.nsc-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1A2B4A;
    border: 1px solid rgba(75, 173, 212, 0.25);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    padding: 10px 14px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(26, 43, 74, 0.2);
    z-index: 10;
}
.nsc-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1A2B4A;
}
.nsc-info:hover .nsc-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* ── Text Input & Select ─────────────────────────────────────── */
.nsc-input,
.nsc-select {
    width: 100%;
    height: 52px;
    background: #F6F8FB;
    border: 1.5px solid #E2E8F4;
    border-radius: 14px;
    padding: 0 18px;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1A2B4A;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.nsc-input::placeholder {
    color: #B0BDCF;
    font-weight: 400;
}
.nsc-input:hover,
.nsc-select:hover {
    border-color: rgba(30, 111, 166, 0.3);
    background: #F0F4F9;
}
.nsc-input:focus,
.nsc-select:focus {
    border-color: #1E6FA6;
    background: #FFFFFF;
    box-shadow:
        0 0 0 3px rgba(30, 111, 166, 0.1),
        0 0 20px rgba(30, 111, 166, 0.04);
}
/* Error state */
.nsc-input.nsc-error,
.nsc-select.nsc-error {
    border-color: #E05A1C;
    background: rgba(224, 90, 28, 0.04);
    box-shadow: 0 0 0 3px rgba(224, 90, 28, 0.06);
}
/* Select custom arrow */
.nsc-select-wrap {
    position: relative;
}
.nsc-select-wrap::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #8A9BBF;
    pointer-events: none;
    transition: border-color 0.2s;
}
.nsc-select-wrap:hover::after {
    border-top-color: #1E6FA6;
}
.nsc-select option {
    background: #FFFFFF;
    color: #1A2B4A;
    padding: 10px;
}
/* ── Divider ─────────────────────────────────────────────────── */
.nsc-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #E2E8F4, transparent);
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}
/* ── Result Section ──────────────────────────────────────────── */
.nsc-result {
    text-align: center;
    position: relative;
    z-index: 1;
}
.nsc-result-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8A9BBF;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}
.nsc-result-number {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #1E6FA6 0%, #4BADD4 50%, #1E6FA6 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nsc-result-number.nsc-pulse {
    animation: nscPulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes nscPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
/* Shimmer animation on gradient */
@keyframes nscShimmer {
    0%   { background-position: 200% 50%; }
    100% { background-position: 0% 50%; }
}
.nsc-result-number.nsc-active {
    animation: nscShimmer 2s ease-in-out infinite, nscPulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-size: 200% 200%;
}
/* Empty state */
.nsc-result-empty {
    font-size: 0.85rem;
    color: #B0BDCF;
    font-weight: 400;
    margin-top: 4px;
}
/* ── Formula Display ─────────────────────────────────────────── */
.nsc-formula-section {
    margin-top: 28px;
    position: relative;
    z-index: 1;
}
.nsc-formula-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: none;
    border: 1px solid #E2E8F4;
    border-radius: 10px;
    padding: 10px 20px;
    color: #8A9BBF;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    margin: 0 auto;
    letter-spacing: 0.3px;
}
.nsc-formula-toggle:hover {
    color: #1E6FA6;
    border-color: rgba(30, 111, 166, 0.25);
    background: rgba(30, 111, 166, 0.04);
}
.nsc-formula-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}
.nsc-formula-toggle.nsc-open svg {
    transform: rotate(180deg);
}
.nsc-formula-box {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}
.nsc-formula-box.nsc-open {
    max-height: 200px;
    opacity: 1;
}
.nsc-formula-inner {
    background: #F6F8FB;
    border: 1px solid #E2E8F4;
    border-radius: 14px;
    padding: 24px;
    margin-top: 16px;
    text-align: center;
}
.nsc-formula-math {
    font-size: 1rem;
    color: #1A2B4A;
    font-weight: 500;
    line-height: 2;
    letter-spacing: 0.3px;
}
.nsc-formula-math .nsc-var {
    color: #1E6FA6;
    font-style: italic;
    font-weight: 600;
}
.nsc-formula-math .nsc-op {
    color: #8A9BBF;
    padding: 0 2px;
}
.nsc-formula-math .nsc-sup {
    font-size: 0.7em;
    vertical-align: super;
    line-height: 0;
}
.nsc-formula-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #E2E8F4;
}
.nsc-formula-legend span {
    font-size: 0.7rem;
    color: #8A9BBF;
    font-weight: 400;
}
.nsc-formula-legend span em {
    color: #1E6FA6;
    font-style: italic;
    font-weight: 600;
    margin-right: 3px;
}
/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 700px) {
    .nsc-card {
        padding: 36px 24px 32px;
        border-radius: 20px;
    }
    .nsc-inputs {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .nsc-title {
        font-size: 1.5rem;
    }
    .nsc-result-number {
        font-size: 3.5rem;
    }
    .nsc-formula-legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}
@media (max-width: 480px) {
    .nsc-wrapper {
        margin: 1.5rem auto;
    }
    .nsc-card {
        padding: 28px 18px 24px;
        border-radius: 16px;
    }
    .nsc-title {
        font-size: 1.3rem;
    }
    .nsc-result-number {
        font-size: 3rem;
    }
    .nsc-badge {
        font-size: 0.65rem;
    }
}
/* ═══════════════════════════════════════════════════════════════
   Arabic / RTL Overrides
   Applied via .nsc-wrapper[dir="rtl"]
   ═══════════════════════════════════════════════════════════════ */
.nsc-wrapper[dir="rtl"] {
    font-family: 'Tajawal', 'Inter', sans-serif;
    direction: rtl;
    text-align: right;
}
.nsc-wrapper[dir="rtl"] .nsc-header {
    text-align: center;
}
.nsc-wrapper[dir="rtl"] .nsc-input,
.nsc-wrapper[dir="rtl"] .nsc-select {
    font-family: 'Tajawal', 'Inter', sans-serif;
    text-align: right;
    direction: rtl;
}
.nsc-wrapper[dir="rtl"] .nsc-label {
    font-family: 'Tajawal', sans-serif;
}
.nsc-wrapper[dir="rtl"] .nsc-title {
    font-family: 'Tajawal', sans-serif;
}
.nsc-wrapper[dir="rtl"] .nsc-subtitle {
    font-family: 'Tajawal', sans-serif;
}
.nsc-wrapper[dir="rtl"] .nsc-badge {
    font-family: 'Tajawal', sans-serif;
}
/* Flip select arrow to left side */
.nsc-wrapper[dir="rtl"] .nsc-select-wrap::after {
    right: auto;
    left: 18px;
}
.nsc-wrapper[dir="rtl"] .nsc-select {
    padding-right: 18px;
    padding-left: 36px;
}
/* Flip tooltip positioning for RTL label alignment */
.nsc-wrapper[dir="rtl"] .nsc-tooltip {
    white-space: nowrap;
}
/* Formula toggle button */
.nsc-wrapper[dir="rtl"] .nsc-formula-toggle {
    font-family: 'Tajawal', 'Inter', sans-serif;
}
/* Legend: flip margin on em */
.nsc-wrapper[dir="rtl"] .nsc-formula-legend span em {
    margin-right: 0;
    margin-left: 3px;
}
/* Result section stays centered */
.nsc-wrapper[dir="rtl"] .nsc-result {
    text-align: center;
}
.nsc-wrapper[dir="rtl"] .nsc-result-label {
    font-family: 'Tajawal', sans-serif;
}
.nsc-wrapper[dir="rtl"] .nsc-result-empty {
    font-family: 'Tajawal', sans-serif;
}
