/* ==================== DUE DATE CALCULATOR STYLES ==================== */

/* Calculator Intro Section */
.calculator-intro-section {
    padding: 60px 0;
    background-color: #ffffff;
}

.calculator-intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.intro-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(255, 182, 193, 0.2);
}

.intro-content {
    padding: 20px;
}

.intro-content h2 {
    font-size: 32px;
    color: #2e3482;
    margin-bottom: 20px;
    font-weight: 700;
}

.intro-content p {
    font-size: 18px;
    color: #53589a;
    line-height: 1.8;
}

/* Calculator Form Section */
.calculator-form-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #fae7f0 0%, #fff5f8 100%);
}

.calculator-card {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 10px 60px rgba(46, 52, 130, 0.08);
    border: 1px solid rgba(46, 52, 130, 0.1);
}

.calculator-header h3 {
    text-align: center;
    font-size: 24px;
    color: #2e3482;
    margin-bottom: 30px;
    font-weight: 600;
}

.method-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.method-btn {
    padding: 20px;
    background: #fff5f8;
    border: 2px solid #fff5f8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #2e3482;
    font-weight: 500;
}

.method-btn i {
    font-size: 32px;
    color: #FFB6C1;
    transition: all 0.3s ease;
}

.method-btn:hover {
    background: #fff5f8;
    transform: translateY(-2px);
}

.method-btn.active {
    background: linear-gradient(135deg, #2e3482 0%, #53589a 100%);
    border-color: #2e3482;
    color: #fff;
}

.method-btn.active i {
    color: #fff;
}

.calculator-form h4 {
    font-size: 20px;
    color: #2e3482;
    margin-bottom: 25px;
    font-weight: 600;
}

.form-section {
    margin-bottom: 30px;
}

.form-section.hidden {
    display: none;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #2e3482;
    margin-bottom: 12px;
    font-weight: 500;
}

.form-group label i {
    font-size: 20px;
    color: #FFB6C1;
}

/* Custom Date Input Styles */
.custom-date-input {
    position: relative;
}

.date-display {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 16px;
    border: 2px solid #fae7f0;
    border-radius: 10px;
    background: #fae7f0;
    color: #2e3482;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: inherit;
}

.date-display:hover {
    border-color: #FFB6C1;
    background: #fff5f8;
}

.date-display.active {
    border-color: #FFB6C1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.1);
}

.date-display.placeholder {
    color: #53589a;
    font-weight: 400;
}

.calendar-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #FFB6C1;
    pointer-events: none;
    transition: all 0.3s ease;
}

.date-display.active ~ .calendar-icon {
    color: #2e3482;
}

/* Custom Calendar Popup - OPTIMIZED SIZE */
.calendar-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(46, 52, 130, 0.15);
    padding: 16px;
    z-index: 1001; /* Higher than overlay */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    width: 320px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.calendar-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Calendar Header - COMPACT */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #fae7f0;
}

.calendar-nav-btn {
    background: #fff5f8;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #2e3482;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.calendar-nav-btn:hover {
    background: #FFB6C1;
    color: white;
    transform: scale(1.05);
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

.calendar-nav-btn i {
    font-size: 16px;
}

.calendar-month-year {
    font-size: 15px;
    font-weight: 600;
    color: #2e3482;
    text-align: center;
    flex: 1;
    padding: 0 8px;
}

/* Calendar Grid - COMPACT */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #53589a;
    padding: 6px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    color: #2e3482;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    background: #fff5f8;
    transform: scale(1.05);
}

.calendar-day.today {
    background: #fae7f0;
    font-weight: 700;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #2e3482 0%, #53589a 100%);
    color: white;
    font-weight: 600;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.disabled {
    color: #ddd;
    cursor: not-allowed;
}

/* Calendar Footer - COMPACT */
.calendar-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #fae7f0;
    gap: 8px;
}

.calendar-footer button {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn {
    background: transparent;
    color: #53589a;
}

.clear-btn:hover {
    background: #fff5f8;
}

.today-btn {
    background: #FFB6C1;
    color: white;
}

.today-btn:hover {
    background: #ff9eb0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.3);
}

/* Calendar Overlay - HIDDEN, NOT USED */
.calendar-overlay {
    display: none !important;
}

/* Cycle Length Selector */
.cycle-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.cycle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FFB6C1;
    background: #fff;
    color: #FFB6C1;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cycle-btn:hover {
    background: #FFB6C1;
    color: #fff;
    transform: scale(1.1);
}

.cycle-btn:active {
    transform: scale(0.95);
}

#cycle-length {
    width: 80px;
    padding: 12px;
    font-size: 20px;
    text-align: center;
    border: 2px solid #fae7f0;
    border-radius: 10px;
    background: #fae7f0;
    color: #2e3482;
    font-weight: 600;
}

/* Remove spinners/arrows from number input */
#cycle-length::-webkit-outer-spin-button,
#cycle-length::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#cycle-length {
    -moz-appearance: textfield;
}

.cycle-note {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #53589a;
    font-size: 14px;
}

.calculate-btn {
    width: 100%;
    padding: 18px 40px;
    background: linear-gradient(135deg, #2e3482 0%, #53589a 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 30px;
    box-shadow: 0 8px 20px rgba(46, 52, 130, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn i {
    font-size: 20px;
}

/* Results Section */
.calculator-results-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #fae7f0 0%, #fff5f8 100%);
}

.calculator-results-section.hidden {
    display: none;
}

/* Note Section */
.calculator-note-section {
    padding: 40px 0 20px;
    background: #fff;
}

.calculator-note-card {
    max-width: 900px;
    margin: 0 auto;
    background: #fff5f8;
    border: 1px solid #fae7f0;
    border-radius: 16px;
    padding: 24px 26px;
    box-shadow: 0 10px 40px rgba(46, 52, 130, 0.06);
}

.calculator-note-text {
    margin: 0 0 12px;
    color: #53589a;
    line-height: 1.7;
    font-size: 16px;
}

.calculator-note-text:last-child {
    margin-bottom: 0;
}

.calculator-note-text a {
    color: #2e3482;
    font-weight: 600;
    text-decoration: none;
}

.calculator-note-text a:hover {
    text-decoration: underline;
}

.results-banner {
    background: linear-gradient(135deg, #FFB6C1 0%, #ff9eb0 100%);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(255, 182, 193, 0.3);
    margin-bottom: 40px;
}

.results-content {
    flex: 1;
}

.results-label {
    font-size: 18px;
    color: #fff;
    margin-bottom: 15px;
    font-weight: 500;
}

.results-date {
    font-size: 42px;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 700;
}

.results-note {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.pregnancy-status {
    text-align: center;
    margin-bottom: 50px;
}

.pregnancy-status p {
    font-size: 20px;
    color: #2e3482;
}

.pregnancy-status strong {
    color: #FFB6C1;
    font-weight: 700;
}

/* Fun Facts Section */
.fun-facts-section {
    margin-top: 50px;
}

.fun-facts-header {
    text-align: center;
    margin-bottom: 40px;
}

.fun-facts-header h3 {
    font-size: 32px;
    color: #2e3482;
    margin-bottom: 10px;
    font-weight: 700;
}

.fun-facts-header p {
    font-size: 16px;
    color: #53589a;
}

.fun-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.fun-fact-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(46, 52, 130, 0.08);
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
}

.fun-fact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(46, 52, 130, 0.12);
}

.fact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2e3482 0%, #53589a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fact-icon i {
    font-size: 28px;
    color: #fff;
}

.fact-content h4 {
    font-size: 18px;
    color: #2e3482;
    margin-bottom: 10px;
    font-weight: 600;
}

.fact-content h4 span {
    color: #FFB6C1;
}

.fact-content p {
    font-size: 15px;
    color: #53589a;
    line-height: 1.6;
}

.recalculate-section {
    text-align: center;
    margin-top: 40px;
}

.recalculate-btn {
    padding: 15px 40px;
    background: #fff;
    color: #2e3482;
    border: 2px solid #2e3482;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.recalculate-btn:hover {
    background: #2e3482;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 52, 130, 0.3);
}

.recalculate-btn i {
    font-size: 18px;
}

/* Information Section - Accordion */
.calculator-info-section {
    padding: 60px 0;
    background: #fff;
}

.info-content {
    max-width: 900px;
    margin: 0 auto;
}

.info-accordion {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.accordion-item {
    border: 1px solid #f0f0f0;
    border-radius: 20px;
    background-color: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(83, 88, 154, 0.08);
}

.accordion-header {
    width: 100%;
    padding: 20px 24px;
    background: none;
    color: #2e3482;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.accordion-header span {
    flex: 1;
}

.accordion-toggle {
    font-size: 1.5rem;
    color: #2e3482;
    transition: transform 0.4s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.accordion-item.active .accordion-header {
    color: #2e3482;
}

.accordion-item.active .accordion-toggle {
    transform: rotate(45deg);
    color: #FFB6C1;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 24px;
}

.accordion-item.active .accordion-content {
    padding-top: 20px;
    margin-bottom: 30px;
}

.accordion-content-inner {
    padding: 0;
}

.accordion-content-inner p {
    font-size: 16px;
    color: #53589a;
    line-height: 1.8;
    margin-bottom: 15px;
}

.accordion-content-inner ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.accordion-content-inner ul li {
    font-size: 16px;
    color: #53589a;
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
}

.accordion-content-inner ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #FFB6C1;
    font-weight: 700;
    font-size: 18px;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.active {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.active {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.active {
    opacity: 1;
    transform: scale(1);
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .calculator-intro-grid {
        gap: 40px;
    }
    
    .fun-facts-grid {
        gap: 25px;
    }
}

@media screen and (max-width: 768px) {
    .calculator-intro-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .intro-content h2 {
        font-size: 26px;
    }
    
    .intro-content p {
        font-size: 16px;
    }
    
    .calculator-card {
        padding: 30px 20px;
    }
    
    .method-selection {
        gap: 15px;
    }
    
    /* Calendar responsive - stays centered */
    .calendar-popup {
        width: 300px;
    }
    
    .results-banner {
        padding: 30px;
    }
    
    .results-date {
        font-size: 28px;
    }
    
    .fun-facts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .fun-fact-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .accordion-header {
        padding: 16px 20px;
        font-size: 0.95rem;
    }
    
    .accordion-toggle {
        font-size: 1.25rem;
        margin-left: 12px;
    }
    
    .accordion-content {
        padding: 0 20px;
    }
}

@media screen and (max-width: 480px) {
    .calculator-intro-section,
    .calculator-form-section,
    .calculator-results-section,
    .calculator-info-section {
        padding: 40px 0;
    }

    .method-selection {
        grid-template-columns: 1fr;
    }

    .cycle-btn {
        height: 40px;
        width: 40px;
        font-size: 20px;
    }

    #cycle-length {
        font-size: 20px;
        width: 70px;
    }
    
    .intro-content h2 {
        font-size: 22px;
    }
    
    .calculator-header h3 {
        font-size: 20px;
    }
    
    .calculator-form h4 {
        font-size: 18px;
    }
    
    .method-btn {
        padding: 15px;
    }
    
    .method-btn i {
        font-size: 28px;
    }
    
    .calculate-btn {
        font-size: 16px;
        padding: 15px 30px;
    }
    
    /* Smaller calendar on mobile */
    .calendar-popup {
        width: 280px;
        padding: 12px;
    }
    
    .calendar-month-year {
        font-size: 14px;
    }
    
    .calendar-nav-btn {
        width: 28px;
        height: 28px;
    }
    
    .calendar-nav-btn i {
        font-size: 14px;
    }
    
    .calendar-weekday {
        font-size: 10px;
        padding: 4px 0;
    }
    
    .calendar-day {
        font-size: 12px;
        min-height: 28px;
    }
    
    .calendar-footer button {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .results-date {
        font-size: 22px;
    }
    
    .pregnancy-status p {
        font-size: 18px;
    }
    
    .fun-facts-header h3 {
        font-size: 26px;
    }
    
    .accordion-header {
        padding: 14px 16px;
        font-size: 0.9rem;
        gap: 10px;
    }
    
    .accordion-toggle {
        font-size: 1.2rem;
        margin-left: 8px;
    }
    
    .accordion-content {
        padding: 0 16px;
    }
    
    .accordion-content-inner p,
    .accordion-content-inner ul li {
        font-size: 15px;
    }
}

/* Extra small devices */
@media screen and (max-width: 360px) {
    .calendar-popup {
        width: 260px;
    }
    
    .calendar-day {
        font-size: 11px;
        min-height: 26px;
    }
}