/* --- ULTIMATE PREGNANCY & FERTILITY CALCULATOR STYLES (v3 - Corrected) --- */

/* Main Container */
#ultimate-calculator { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 650px; margin: 20px auto; padding: 25px; background-color: #fff; border: 1px solid #e4e7eb; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }

/* --- Base Form Styles --- */
.form-section { padding: 20px; margin-bottom: 15px; border: 1px solid #e9ecef; border-radius: 8px; background-color: #f8f9fa; }
.form-group { margin-bottom: 18px; position: relative; }
.form-group:last-child { margin-bottom: 0; }
#ultimate-form label { display: block; font-weight: 500; font-size: 15px; color: #34495e; margin-bottom: 8px; }
.sub-label { font-weight: 600; color: #495057; margin-top: 20px; margin-bottom: 10px; display: block; }
#ultimate-form input[type="date"], #ultimate-form input[type="number"], #ultimate-form select {
    width: 100%; height: 100%; padding: 12px; border: 1px solid #dcdfe6; border-radius: 6px; box-sizing: border-box;
    font-size: 16px; background-color: #fff; color: #333; transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#ultimate-calculate-btn { width: 100%; font-size: 16px; font-weight: bold; cursor: pointer; border: none; border-radius: 8px; padding: 15px; margin-top: 10px; transition: all 0.3s ease; height: auto; }
#ultimate-calculate-btn:disabled { background: #cccccc; cursor: not-allowed; opacity: 0.8; }
.form-divider { border: none; border-top: 1px solid #e9ecef; margin: 20px 0; }

/* --- Default TTC Green Theme --- */
#ultimate-form input:focus, #ultimate-form select:focus { outline: none; border-color: #1abc9c; box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.2); }
#ultimate-calculate-btn { background: #16a085; color: #fff; }
#ultimate-calculate-btn:hover:not(:disabled) { background: #1abc9c; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.btn-toggle.selected { background-color: #1abc9c; color: #fff; border-color: #16a085; font-weight: bold; }
.accordion-header[aria-expanded="true"] { background-color: #e8f8f5; }
.spinner { border: 4px solid #d4f4ec; border-top-color: #1abc9c; }
.hero-item.highlight span { color: #16a085; }
.fertile {background-color:#e8f8f5; border-color:#d4f4ec}
.highest {background-color:#16a085; color:#fff; border-color:#117a65}
.ovulate {background-color:#a3e4d7; border-color:#76d7c4}
.box.f {background:#e8f8f5} .box.h {background:#16a085} .box.o {background:#a3e4d7}
#specific-date-result { color: #16a085; }

/* --- TTA (Trying To Avoid) Blue Theme --- */
.tta-theme #ultimate-form input:focus, .tta-theme #ultimate-form select:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2); }
.tta-theme #ultimate-calculate-btn { background: #2980b9; }
.tta-theme #ultimate-calculate-btn:hover:not(:disabled) { background: #3498db; }
.tta-theme .btn-toggle.selected { background-color: #3498db; border-color: #2980b9; }
.tta-theme .accordion-header[aria-expanded="true"] { background-color: #eaf4ff; }
.tta-theme .spinner { border-color: #d6eaf8; border-top-color: #3498db; }
.tta-theme .hero-item.highlight span { color: #2980b9; }
.tta-theme .fertile {background-color: #eaf4ff; border-color: #d6eaf8;}
.tta-theme .highest {background-color: #2980b9; color: #fff; border-color: #2471a3;}
.tta-theme .ovulate {background-color: #aed6f1; border-color: #85c1e9;}
.tta-theme .box.f {background:#eaf4ff} .tta-theme .box.h {background:#2980b9} .tta-theme .box.o {background:#aed6f1}
.tta-theme #specific-date-result { color: #2980b9; }

/* Goal Selector */
.goal-selector { display: flex; gap: 10px; }
.btn-toggle { flex: 1; padding: 12px; background-color: #f1f3f5; color: #495057; border: 1px solid #ced4da; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; font-weight: 500; }

/* Accordion */
.accordion { border-top: 1px solid #f1f3f5; }
.accordion-item { border-bottom: 1px solid #f1f3f5; }
.accordion-header { all: unset; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 5px; font-size: 16px; font-weight: 600; color: #34495e !important; cursor: pointer; box-sizing: border-box; border-radius: 4px; transition: background-color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.accordion-header:hover { background-color: #f8f9fa; }
.accordion-header .icon { width: 10px; height: 10px; border-right: 2px solid #34495e; border-bottom: 2px solid #34495e; transform: rotate(45deg); transition: transform 0.3s ease; }
.accordion-header[aria-expanded="true"] .icon { transform: rotate(-135deg); }
.accordion-content { display: none; padding: 10px 5px 15px; }

/* Height/Weight Alignment */
.form-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 10px; }
.form-row .form-group { margin-bottom: 0; }
.input-group { flex: 1; min-width: 0; }
.unit-selector-group { flex-grow: 0; flex-shrink: 0; flex-basis: 90px; }
.height-group { display: flex; gap: 10px; flex: 1; }
.height-group.cm-group { display: none; }
.height-group input { flex: 1 1 50%; min-width: 40px; }

/* Result Area */
#ultimate-result { display: none; margin-top: 25px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; margin: 30px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-wrapper { opacity: 0; transform: translateY(15px); transition: opacity 0.4s ease, transform 0.4s ease; }
.result-wrapper.visible { opacity: 1; transform: translateY(0); }
.result-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; background-color: #f8f9fa; border-radius: 8px; padding: 20px; }
.hero-item { text-align: center; }
.hero-item label { display: block; font-size: 14px; color: #6c757d; margin-bottom: 5px; }
.hero-item span { display: block; font-size: 18px; font-weight: 600; color: #2c3e50; }
.hero-item.highlight span { font-size: 20px; }

/* Result Accordion & Details */
.accordion-results { margin-top: 20px; }
.details-list { display: flex; flex-direction: column; gap: 12px; }
.detail-item { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; padding: 10px 0; border-bottom: 1px solid #f1f3f5; }
.detail-item:last-child { border-bottom: none; }
.detail-item strong { font-weight: 500; color: #303133; margin-right: 15px; }
.detail-item span { color: #606266; text-align: right; font-weight: 500; }

/* Calendar in Results */
.cc_calendar { padding-top: 15px; }
.cc_header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.cc_header button { background: #f1f3f5; color: #495057; border: 1px solid #dee2e6; border-radius: 50%; width: 35px; height: 35px; cursor: pointer; font-weight: bold; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.cc_header span { font-weight: 600; font-size: 18px; color: #2c3e50; }
.cc_weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 500; color: #909399; margin-bottom: 5px; font-size: 14px; }
.cc_days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cc_day { border: 1px solid #f1f3f5; border-radius: 6px; position: relative; cursor: pointer; aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: space-between; padding: 4px; overflow: hidden; }
.cc_day .num { font-size: 13px; text-align: left; } .cc_day .pct { font-size: 11px; text-align: center; color: #6c757d; font-weight: 500; }
.menstruation{background-color:#ffe3e3;border-color:#ffc9c9}
.light-menstruation{background-color:#fff0f0;border-color:#ffe3e3}
.cc_legend { display: flex; align-items: center; justify-content: center; font-size: 13px; gap: 15px; flex-wrap: wrap; margin-top: 15px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.box { width: 14px; height: 14px; border-radius: 3px; }
.box.m{background:#ffe3e3}

/* Specific Date Checker */
#specific-date-checker { padding-top: 10px; }
#specific-date-checker #specific-date-btn { height: 100%; flex-basis: 100px; background-color: #495057; color: white; border: none; font-weight: 500; }
#specific-date-result { text-align: center; font-weight: 600; margin-top: 15px; font-size: 16px; }




/* --- FIX: Make text white on the dark "highest" chance day --- */
.cc_day.highest .num,
.cc_day.highest .pct {
    color: white;
}

.share-section {
    text-align: center;
    margin-top: 20px;
}
#ultimate-share-btn {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
    /* ... other button styles ... */
}