/* ============================================
   PREGNANCY CALCULATOR - FIGMA LEVEL CSS
   Version 2.0
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---- Root Variables ---- */
.pdc-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.pdc-wrap {
    --pink:        #F72585;
    --purple:      #7209B7;
    --violet:      #560BAD;
    --blue:        #480CA8;
    --grad:        linear-gradient(135deg, #F72585 0%, #7209B7 100%);
    --grad-soft:   linear-gradient(135deg,
                   rgba(247,37,133,0.08) 0%,
                   rgba(114,9,183,0.08) 100%);
    --white:       #FFFFFF;
    --bg:          #F8F4FF;
    --card-bg:     #FFFFFF;
    --border:      rgba(114,9,183,0.12);
    --text:        #1A1A2E;
    --text-muted:  #6B7280;
    --shadow-card: 0 32px 80px rgba(114,9,183,0.18),
                   0 8px 24px rgba(247,37,133,0.10);
    --shadow-btn:  0 12px 32px rgba(247,37,133,0.45);
    --radius-xl:   24px;
    --radius-lg:   16px;
    --radius-md:   12px;
    --radius-sm:   8px;
    font-family: 'Inter', sans-serif;
    position: relative;
    padding: 40px 16px;
    background: var(--bg);
    min-height: 100%;
}

/* ---- Floating Blobs ---- */
.pdc-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}
.pdc-blob-1 {
    width: 300px; height: 300px;
    background: rgba(247,37,133,0.12);
    top: -60px; left: -80px;
}
.pdc-blob-2 {
    width: 250px; height: 250px;
    background: rgba(114,9,183,0.10);
    bottom: 40px; right: -60px;
}
.pdc-blob-3 {
    width: 180px; height: 180px;
    background: rgba(72,12,168,0.08);
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
}

/* ---- Main Card ---- */
.pdc-card {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* ---- Header ---- */
.pdc-header {
    background: var(--grad);
    padding: 28px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.pdc-header::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -80px; right: -60px;
}

.pdc-header::before {
    content: '';
    position: absolute;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -40px; left: 30%;
}

.pdc-header-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
}

.pdc-header-icon svg {
    width: 28px; height: 28px;
}

.pdc-header-text h2 {
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.pdc-header-text p {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 400;
    margin-top: 3px;
}

/* ---- Body ---- */
.pdc-body {
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---- Step ---- */
.pdc-step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pdc-step-num {
    width: 26px; height: 26px;
    background: var(--grad);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(247,37,133,0.35);
}

.pdc-step-label span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.1px;
}

/* ---- Select Dropdown ---- */
.pdc-select-wrap {
    position: relative;
}

.pdc-select-wrap select {
    width: 100%;
    padding: 14px 46px 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text);
    background: #FAFAFF;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.25s ease;
    outline: none;
}

.pdc-select-wrap select:focus {
    border-color: var(--pink);
    background: white;
    box-shadow: 0 0 0 4px rgba(247,37,133,0.08);
}

.pdc-select-wrap select:hover {
    border-color: rgba(114,9,183,0.30);
}

.pdc-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--purple);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.pdc-select-arrow svg {
    width: 18px; height: 18px;
}

/* ---- Date Input ---- */
.pdc-date-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pdc-date-icon {
    position: absolute;
    left: 14px;
    color: var(--purple);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.pdc-date-icon svg {
    width: 20px; height: 20px;
}

.pdc-date-wrap input[type="date"] {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text);
    background: #FAFAFF;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.25s ease;
    outline: none;
}

.pdc-date-wrap input[type="date"]:focus {
    border-color: var(--pink);
    background: white;
    box-shadow: 0 0 0 4px rgba(247,37,133,0.08);
}

.pdc-date-wrap input[type="date"]:hover {
    border-color: rgba(114,9,183,0.30);
}

/* ---- Cycle Length ---- */
.pdc-cycle-wrap {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--grad-soft);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
}

.pdc-cycle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
}

.pdc-cycle-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    overflow: hidden;
}

.pdc-cycle-btn {
    width: 36px; height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.pdc-cycle-btn:hover {
    background: var(--grad-soft);
}

.pdc-cycle-input-wrap input[type="number"] {
    width: 44px;
    text-align: center;
    border: none;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: white;
    padding: 0;
    height: 36px;
    outline: none;
    -moz-appearance: textfield;
}

.pdc-cycle-input-wrap input[type="number"]::-webkit-inner-spin-button,
.pdc-cycle-input-wrap input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.pdc-cycle-note {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Calculate Button ---- */
#pdc_btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-btn);
}

#pdc_btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.15),
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s;
}

#pdc_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(247,37,133,0.50);
}

#pdc_btn:hover::before {
    opacity: 1;
}

#pdc_btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-btn);
}

.pdc-btn-text {
    font-size: 16px;
    font-weight: 700;
}

.pdc-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.20);
    border-radius: 50%;
}

/* ---- Result Section ---- */
.pdc-result {
    display: none;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.45s cubic-bezier(0.34,1.56,0.64,1);
    border-top: 1px solid var(--border);
    padding: 28px 30px;
    background: linear-gradient(
        180deg,
        rgba(247,37,133,0.02) 0%,
        rgba(114,9,183,0.03) 100%
    );
}

.pdc-result-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Result Header Badge */
.pdc-result-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.pdc-result-badge {
    background: var(--grad);
    color: white;
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(247,37,133,0.30);
}

/* Due Date Big Card */
.pdc-due-card {
    background: var(--grad);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(247,37,133,0.25);
}

.pdc-due-card::before {
    content: '';
    position: absolute;
    width: 150px; height: 150px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
    top: -50px; right: -30px;
}

.pdc-due-card::after {
    content: '';
    position: absolute;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -30px; left: -20px;
}

.pdc-due-label {
    color: rgba(255,255,255,0.80);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.pdc-due-date {
    color: white;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.pdc-due-sub {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
}

/* Stats Row */
.pdc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pdc-stat-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.25s ease;
}

.pdc-stat-card:hover {
    border-color: var(--pink);
    box-shadow: 0 6px 20px rgba(247,37,133,0.10);
    transform: translateY(-2px);
}

.pdc-stat-icon {
    font-size: 22px;
    margin-bottom: 8px;
    line-height: 1;
}

.pdc-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
}

.pdc-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
}

/* Progress Bar */
.pdc-progress-wrap {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.pdc-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.pdc-progress-top span:last-child {
    color: var(--pink);
    font-weight: 700;
}

.pdc-progress-bar {
    height: 10px;
    background: #F3EDF9;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}

.pdc-progress-fill {
    height: 100%;
    background: var(--grad);
    border-radius: 100px;
    width: 0%;
    transition: width 1s cubic-bezier(0.34,1.56,0.64,1);
}

.pdc-progress-markers {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Footer ---- */
.pdc-footer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 30px 24px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border);
    background: #FAFAFF;
}

.pdc-footer svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--purple);
}

/* ---- Mobile ---- */
@media (max-width: 520px) {

    .pdc-wrap {
        padding: 20px 10px;
    }

    .pdc-card {
        border-radius: var(--radius-lg);
    }

    .pdc-header {
        padding: 22px 20px;
    }

    .pdc-body {
        padding: 22px 20px;
        gap: 20px;
    }

    .pdc-result {
        padding: 22px 20px;
    }

    .pdc-footer {
        padding: 14px 20px 20px;
    }

    .pdc-due-date {
        font-size: 18px;
    }

    .pdc-stats {
        gap: 8px;
    }

    .pdc-stat-value {
        font-size: 15px;
    }

    .pdc-stat-card {
        padding: 12px 8px;
    }

    .pdc-header-text h2 {
        font-size: 18px;
    }
}

@media (max-width: 360px) {
    .pdc-due-date {
        font-size: 16px;
    }
    .pdc-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .pdc-stat-value {
        font-size: 13px;
    }
    .pdc-stat-label {
        font-size: 10px;
    }
}
