/* ============================================================
   PREGNANCY CALCULATOR — Premium Tracker UI
   ============================================================ */

.tool-page:has(.preg-calc) {
    max-width: 760px;
}

.preg-calc {
    position: relative;
    background: linear-gradient(155deg, #1a0a2e 0%, #2d1b4e 40%, #1e1035 100%);
    border-radius: 28px;
    padding: 32px 28px 28px;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 24px 60px rgba(244, 114, 182, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pc-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    opacity: 0.4;
}

.pc-glow-1 {
    width: 300px;
    height: 300px;
    background: #f472b6;
    top: -100px;
    right: -80px;
    animation: pcPulse 5s ease-in-out infinite;
}

.pc-glow-2 {
    width: 250px;
    height: 250px;
    background: #a78bfa;
    bottom: -80px;
    left: -60px;
    animation: pcPulse 5s ease-in-out infinite 2.5s;
}

@keyframes pcPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.06); }
}

.pc-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.pc-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(244, 114, 182, 0.15);
    border: 1px solid rgba(244, 114, 182, 0.3);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.pc-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f472b6;
    animation: pcBlink 2s ease-in-out infinite;
}

@keyframes pcBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pc-subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    margin: 0;
}

/* Methods */
.pc-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.pc-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.pc-method i { width: 18px; height: 18px; }

.pc-method:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pc-method.active {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.25), rgba(167, 139, 250, 0.25));
    border-color: rgba(244, 114, 182, 0.5);
    color: #fff;
    box-shadow: 0 4px 16px rgba(244, 114, 182, 0.2);
}

/* Form */
.pc-form {
    position: relative;
    z-index: 1;
}

.pc-field {
    margin-bottom: 16px;
}

.pc-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.pc-field label i { width: 16px; height: 16px; opacity: 0.7; }

.pc-date-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    color-scheme: dark;
}

.pc-date-input:focus {
    outline: none;
    border-color: #f472b6;
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.2);
}

.pc-cycle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pc-range {
    flex: 1;
    accent-color: #f472b6;
    height: 6px;
}

.pc-cycle-val {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #f472b6;
}

.pc-ivf-btns {
    display: flex;
    gap: 10px;
}

.pc-ivf-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.pc-ivf-btn.active {
    background: rgba(244, 114, 182, 0.2);
    border-color: #f472b6;
    color: #fff;
}

.pc-btn-calc {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, #f472b6, #a78bfa);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}

.pc-btn-calc:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(244, 114, 182, 0.35);
}

.pc-btn-calc:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results */
.pc-results {
    position: relative;
    z-index: 1;
    animation: pcFadeIn 0.4s ease;
}

@keyframes pcFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.pc-progress-section {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.pc-gauge-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.pc-gauge {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pc-gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 12;
}

.pc-gauge-fill {
    fill: none;
    stroke: url(#pcGrad);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.pc-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pc-week-big {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #f472b6, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pc-week-plus {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.pc-week-lbl {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.pc-progress-info {
    flex: 1;
    min-width: 200px;
}

.pc-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f472b6, #a78bfa);
    border-radius: 999px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.pc-progress-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
}

.pc-progress-text span:first-child {
    font-weight: 700;
    color: #f472b6;
    font-size: 1.1rem;
}

.pc-remaining {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
}

/* Trimesters */
.pc-trimesters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.pc-tri {
    text-align: center;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.3s;
    opacity: 0.5;
}

.pc-tri.active {
    opacity: 1;
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(167, 139, 250, 0.15));
    border-color: rgba(244, 114, 182, 0.4);
    box-shadow: 0 4px 20px rgba(244, 114, 182, 0.15);
    transform: scale(1.03);
}

.pc-tri.done {
    opacity: 0.7;
}

.pc-tri-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f472b6;
}

.pc-tri-name {
    font-size: 0.78rem;
    margin-top: 4px;
}

.pc-tri-range {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

/* Baby card */
.pc-baby-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    margin-bottom: 20px;
}

.pc-baby-emoji {
    font-size: 3.5rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(244, 114, 182, 0.3));
}

.pc-baby-title {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 4px;
}

.pc-baby-size {
    font-size: 1.3rem;
    font-weight: 700;
}

.pc-baby-meta {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Dates grid */
.pc-dates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.pc-date-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.pc-date-card.highlight {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.12), rgba(167, 139, 250, 0.08));
    border-color: rgba(244, 114, 182, 0.25);
    grid-column: span 2;
}

.pc-date-card i {
    width: 18px;
    height: 18px;
    color: #f472b6;
    margin-bottom: 8px;
}

.pc-date-lbl {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.pc-date-val {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    word-wrap: break-word;
}

.pc-date-sub {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
}

/* Timeline */
.pc-timeline-wrap {
    margin-bottom: 20px;
}

.pc-timeline-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.pc-timeline-title i { width: 16px; height: 16px; }

.pc-timeline {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding: 8px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 114, 182, 0.4) transparent;
}

.pc-tl-week {
    flex-shrink: 0;
    width: 14px;
    height: 32px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    cursor: default;
    transition: all 0.2s;
}

.pc-tl-week.passed {
    background: rgba(167, 139, 250, 0.4);
}

.pc-tl-week.active {
    background: linear-gradient(180deg, #f472b6, #a78bfa);
    height: 40px;
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.5);
}

.pc-tl-week::after {
    content: attr(data-week);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.pc-tl-week.active::after {
    color: #f472b6;
    font-weight: 700;
}

/* Milestones */
.pc-milestones {
    margin-bottom: 20px;
}

.pc-milestones-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.pc-milestones-title i { width: 16px; height: 16px; }

.pc-milestone {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 8px;
    border-right: 3px solid transparent;
}

.pc-milestone.done {
    border-right-color: #a78bfa;
    opacity: 0.7;
}

.pc-milestone.current {
    border-right-color: #f472b6;
    background: rgba(244, 114, 182, 0.1);
}

.pc-milestone.upcoming {
    border-right-color: rgba(255, 255, 255, 0.15);
}

.pc-ms-week {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pc-milestone.current .pc-ms-week {
    background: linear-gradient(135deg, #f472b6, #a78bfa);
}

.pc-ms-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    word-wrap: break-word;
}

/* Actions */
.pc-actions {
    display: flex;
    gap: 10px;
}

.pc-btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
}

.pc-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* States */
.pc-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #fca5a5;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.pc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px;
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.7);
}

.pc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f472b6;
    border-radius: 50%;
    animation: pcSpin 0.8s linear infinite;
}

@keyframes pcSpin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 540px) {
    .preg-calc { padding: 24px 18px 20px; }

    .pc-methods {
        grid-template-columns: repeat(2, 1fr);
    }

    .pc-progress-section {
        flex-direction: column;
    }

    .pc-dates-grid {
        grid-template-columns: 1fr;
    }

    .pc-date-card.highlight {
        grid-column: span 1;
    }

    .pc-actions {
        flex-direction: column;
    }
}
