/* Pregnancy Due Date Calculator Styles */

[hidden] {
    display: none !important;
}

.apple-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .apple-glass {
    background: rgba(18, 18, 20, 0.7);
}

.apple-card {
    background: #ffffff;
    border: 1px solid #e4e4e7;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.apple-card:hover {
    border-color: rgba(244, 63, 94, 0.3);
    box-shadow: 0 10px 30px -10px rgba(244, 63, 94, 0.12);
}

.dark .apple-card {
    background: rgba(24, 24, 27, 0.65);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.dark .apple-card:hover {
    border-color: rgba(244, 63, 94, 0.25);
    box-shadow: 0 10px 30px -10px rgba(244, 63, 94, 0.15);
}

.text-glow {
    text-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

.trimester-bar {
    height: 10px;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.dark .trimester-bar {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}

.trimester-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #fb7185, #f43f5e);
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timeline Milestones Styles */
.timeline-milestone {
    position: relative;
    transition: all 0.3s ease;
}

/* Continuous connecting track: starts at the vertical center of the marker (top: 14px) and extends down to the next marker */
.timeline-milestone::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: -14px;
    width: 2px;
    background-color: #e4e4e7;
    transition: background-color 0.3s ease;
}

.dark .timeline-milestone::before {
    background-color: rgba(255, 255, 255, 0.1);
}

.timeline-milestone.passed::before {
    background-color: #f43f5e;
}

.timeline-milestone.current-focus::before {
    background-color: #f43f5e;
}

.timeline-milestone:last-child::before {
    display: none;
}

/* Preset Buttons Active State */
.preset-btn.active-preset {
    border-color: rgba(244, 63, 94, 0.5) !important;
    background-color: rgba(244, 63, 94, 0.12) !important;
    box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.3);
}

.dark .preset-btn.active-preset {
    border-color: rgba(244, 63, 94, 0.5) !important;
    background-color: rgba(244, 63, 94, 0.2) !important;
}

/* 40-Week Pregnancy Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .calendar-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border-width: 1px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.calendar-cell:hover {
    transform: translateY(-2px);
}

.calendar-cell.passed {
    background-color: rgba(251, 113, 133, 0.12);
    color: #e11d48;
    border-color: rgba(251, 113, 133, 0.25);
}

.dark .calendar-cell.passed {
    background-color: rgba(251, 113, 133, 0.08);
    color: #fca5a5;
    border-color: rgba(251, 113, 133, 0.2);
}

.calendar-cell.current {
    background-color: #f43f5e;
    color: #ffffff;
    border-color: #fb7185;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

.calendar-cell.future {
    background-color: #f4f4f5;
    color: #71717a;
    border-color: #e4e4e7;
}

.dark .calendar-cell.future {
    background-color: rgba(24, 24, 27, 0.6);
    color: #a1a1aa;
    border-color: rgba(255, 255, 255, 0.05);
}

.calendar-cell.has-checkup::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #0d9488;
}

.dark .calendar-cell.has-checkup::after {
    background-color: #2dd4bf;
}

.calendar-cell.current.has-checkup::after {
    background-color: #ffffff;
}

/* Collapsible result sections (Milestones, Prenatal Checkups) */
.pdd-collapse-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 0.75rem;
}

.pdd-collapse-toggle:focus-visible {
    outline: 2px solid #f43f5e;
    outline-offset: 6px;
}

.pdd-collapse-chevron {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0 0.85rem;
    border-radius: 9999px;
    border: 1px solid;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pdd-collapse-chevron i {
    font-size: 0.625rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pdd-collapse-toggle[aria-expanded="true"] .pdd-collapse-chevron i {
    transform: rotate(180deg);
}

.pdd-collapse-toggle:hover .pdd-collapse-chevron {
    transform: translateY(-1px);
}

.pdd-collapse-chevron--rose {
    color: #e11d48;
    background-color: #fff1f2;
    border-color: #fecdd3;
}

.pdd-collapse-toggle:hover .pdd-collapse-chevron--rose,
.pdd-collapse-toggle[aria-expanded="true"] .pdd-collapse-chevron--rose {
    background-color: #ffe4e6;
    border-color: #fda4af;
    box-shadow: 0 4px 12px -4px rgba(244, 63, 94, 0.35);
}

.dark .pdd-collapse-chevron--rose {
    color: #fda4af;
    background-color: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.3);
}

.dark .pdd-collapse-toggle:hover .pdd-collapse-chevron--rose,
.dark .pdd-collapse-toggle[aria-expanded="true"] .pdd-collapse-chevron--rose {
    background-color: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.45);
}

.pdd-collapse-chevron--teal {
    color: #0f766e;
    background-color: #f0fdfa;
    border-color: #99f6e4;
}

.pdd-collapse-toggle:hover .pdd-collapse-chevron--teal,
.pdd-collapse-toggle[aria-expanded="true"] .pdd-collapse-chevron--teal {
    background-color: #ccfbf1;
    border-color: #5eead4;
    box-shadow: 0 4px 12px -4px rgba(13, 148, 136, 0.35);
}

.dark .pdd-collapse-chevron--teal {
    color: #5eead4;
    background-color: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.3);
}

.dark .pdd-collapse-toggle:hover .pdd-collapse-chevron--teal,
.dark .pdd-collapse-toggle[aria-expanded="true"] .pdd-collapse-chevron--teal {
    background-color: rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.45);
}

/* Height animation without measuring: 0fr -> 1fr grid row */
.pdd-collapse-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pdd-collapse-body.is-open {
    grid-template-rows: 1fr;
}

.pdd-collapse-inner {
    min-height: 0;
    overflow: hidden;
}

.pdd-collapse-body.is-open .pdd-collapse-inner {
    animation: pdd-collapse-fade 0.35s ease;
}

@keyframes pdd-collapse-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
    .pdd-collapse-label {
        display: none;
    }

    .pdd-collapse-chevron {
        padding: 0;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pdd-collapse-body,
    .pdd-collapse-chevron,
    .pdd-collapse-chevron i {
        transition: none;
    }

    .pdd-collapse-body.is-open .pdd-collapse-inner {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .pdd-collapse-body {
        grid-template-rows: 1fr !important;
    }

    .pdd-collapse-chevron {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    header,
    footer,
    nav,
    #calculator-workspace>div>div:first-child,
    #history-panel,
    #educational-content,
    #faqs-section,
    .related-tools-section,
    .bg-gradient-to-b,
    .absolute {
        display: none !important;
    }

    #calculator-workspace {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    #calculator-workspace>div {
        display: block !important;
    }

    .apple-glass,
    .apple-card {
        background: white !important;
        color: black !important;
        border: 1px solid #e4e4e7 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        margin-bottom: 2rem !important;
        padding: 1.5rem !important;
        page-break-inside: avoid;
    }

    .text-white {
        color: #09090b !important;
    }

    .text-zinc-400,
    .text-zinc-500,
    .text-zinc-300,
    .text-zinc-600 {
        color: #3f3f46 !important;
    }

    .bg-zinc-950,
    .bg-zinc-950/40,
    .bg-zinc-950/30,
    .bg-zinc-950/20 {
        background: #f4f4f5 !important;
        border-color: #e4e4e7 !important;
    }

    .trimester-bar {
        background: #e4e4e7 !important;
        border: 1px solid #d4d4d8 !important;
    }

    .trimester-fill {
        background: #f43f5e !important;
    }

    #results-calculated,
    #milestones-section,
    #size-guide,
    #prenatal-checkups-card,
    #mama-care-card,
    #pregnancy-calendar-card {
        display: block !important;
    }

    #btn-save,
    #btn-share,
    #btn-print,
    #btn-csv,
    #btn-reset,
    #slider-growth-week,
    .preset-btn,
    #results-idle {
        display: none !important;
    }
}
