/* ============================================
   LUTEAL PHASE CALCULATOR ADVANCED - CSS
   Version 1.0
============================================ */

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

.lpc-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

.lpc-wrap {
    --pink:        #F72585;
    --purple:      #7209B7;
    --violet:      #560BAD;
    --blue:        #480CA8;
    --green:       #06A77D;
    --amber:       #E8A33D;
    --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%;
}

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

.lpc-card {
    position: relative;
    z-index: 1;
    max-width: 540px;
    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 ---- */
.lpc-header {
    background: var(--grad);
    padding: 28px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.lpc-header::after { content: ''; position: absolute; width: 200px; height: 200px; background: rgba(255,255,255,0.06); border-radius: 50%; top: -80px; right: -60px; }
.lpc-header::before { content: ''; position: absolute; width: 120px; height: 120px; background: rgba(255,255,255,0.04); border-radius: 50%; bottom: -40px; left: 30%; }

.lpc-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);
}
.lpc-header-icon svg { width: 28px; height: 28px; }
.lpc-header-text { flex: 1; min-width: 0; }
.lpc-header-text h2 { color: #FFFFFF; font-size: 19px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.2; }
.lpc-header-text p { color: rgba(255,255,255,0.75); font-size: 12.5px; font-weight: 400; margin-top: 3px; }

.lpc-history-btn {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: background 0.2s;
}
.lpc-history-btn:hover { background: rgba(255,255,255,0.28); }

/* ---- History Panel ---- */
.lpc-history-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: #FAFAFF;
    border-bottom: 1px solid var(--border);
}
.lpc-history-panel.lpc-history-open { max-height: 320px; overflow-y: auto; }
.lpc-history-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.lpc-history-clear { background: none; border: none; color: var(--pink); font-size: 11px; font-weight: 700; cursor: pointer; }
.lpc-history-list { padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.lpc-history-empty { font-size: 13px; color: var(--text-muted); padding: 12px 0; text-align: center; }
.lpc-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}
.lpc-history-item-date { font-size: 13px; font-weight: 700; color: var(--text); }
.lpc-history-item-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.lpc-history-item-load {
    background: var(--grad-soft);
    border: none;
    color: var(--purple);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 100px;
    cursor: pointer;
    flex-shrink: 0;
}
.lpc-history-item-load:hover { background: var(--grad); color: white; }

/* ---- Explainer (What is Luteal Phase) ---- */
.lpc-explainer { border-bottom: 1px solid var(--border); }
.lpc-explainer-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px;
    background: var(--grad-soft);
    border: none;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}
.lpc-explainer-toggle svg { color: var(--purple); transition: transform 0.25s ease; flex-shrink: 0; }
#lpc_explainer_arrow.lpc-explainer-arrow-open { transform: rotate(180deg); }
.lpc-explainer-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 30px;
}
.lpc-explainer-body.lpc-explainer-open { max-height: 400px; padding: 16px 30px; }
.lpc-explainer-body p { font-size: 12.5px; color: var(--text-muted); line-height: 1.65; margin-bottom: 10px; }
.lpc-explainer-body p:last-child { margin-bottom: 0; }
.lpc-explainer-body strong { color: var(--text); }

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

.lpc-step-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lpc-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);
}
.lpc-step-label span { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0.1px; }
.lpc-hint { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-top: 8px; }

/* ---- Date Input ---- */
.lpc-date-wrap { position: relative; display: flex; align-items: center; }
.lpc-date-icon { position: absolute; left: 14px; color: var(--purple); display: flex; align-items: center; pointer-events: none; z-index: 1; }
.lpc-date-icon svg { width: 20px; height: 20px; }
.lpc-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;
}
.lpc-date-wrap input[type="date"]:focus { border-color: var(--pink); background: white; box-shadow: 0 0 0 4px rgba(247,37,133,0.08); }
.lpc-date-wrap input[type="date"]:hover { border-color: rgba(114,9,183,0.30); }

/* ---- Select Dropdown ---- */
.lpc-select-wrap { position: relative; }
.lpc-select-wrap select {
    width: 100%;
    padding: 14px 46px 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    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;
}
.lpc-select-wrap select:focus { border-color: var(--pink); background: white; box-shadow: 0 0 0 4px rgba(247,37,133,0.08); }
.lpc-select-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--purple); pointer-events: none; }

/* ---- Cycle Length ---- */
.lpc-cycle-wrap {
    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);
}
.lpc-cycle-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); flex: 1; white-space: nowrap; }
.lpc-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; }
.lpc-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;
}
.lpc-cycle-btn:hover { background: var(--grad-soft); }
.lpc-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;
}
.lpc-cycle-input-wrap input[type="number"]::-webkit-inner-spin-button,
.lpc-cycle-input-wrap input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.lpc-cycle-note { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ---- Calculate Button ---- */
#lpc_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);
}
#lpc_btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent); opacity: 0; transition: opacity 0.3s; }
#lpc_btn:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(247,37,133,0.50); }
#lpc_btn:hover::before { opacity: 1; }
#lpc_btn:active { transform: translateY(0); box-shadow: var(--shadow-btn); }
.lpc-btn-text { font-size: 16px; font-weight: 700; }
.lpc-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 ---- */
.lpc-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%);
}
.lpc-result-visible { opacity: 1 !important; transform: translateY(0) !important; }

.lpc-result-header { display: flex; justify-content: center; margin-bottom: 20px; }
.lpc-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); }

/* Luteal Phase Length Big Card */
.lpc-due-card {
    background: var(--grad);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(247,37,133,0.25);
}
.lpc-due-card::before { content: ''; position: absolute; width: 150px; height: 150px; background: rgba(255,255,255,0.07); border-radius: 50%; top: -50px; right: -30px; }
.lpc-due-card::after { content: ''; position: absolute; width: 100px; height: 100px; background: rgba(255,255,255,0.05); border-radius: 50%; bottom: -30px; left: -20px; }
.lpc-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; }
.lpc-due-date { color: white; font-size: 30px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; margin-bottom: 8px; }
.lpc-due-sub { color: rgba(255,255,255,0.75); font-size: 13px; font-weight: 500; }

/* Short Luteal Alert */
.lpc-alert-card {
    display: flex;
    gap: 12px;
    background: rgba(247,37,133,0.06);
    border: 1.5px solid rgba(247,37,133,0.25);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
}
.lpc-alert-icon { font-size: 20px; flex-shrink: 0; }
.lpc-alert-title { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.lpc-alert-text { font-size: 11.5px; color: var(--text-muted); line-height: 1.55; }

/* Stats Row */
.lpc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.lpc-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; }
.lpc-stat-card:hover { border-color: var(--pink); box-shadow: 0 6px 20px rgba(247,37,133,0.10); transform: translateY(-2px); }
.lpc-stat-icon { font-size: 22px; margin-bottom: 8px; line-height: 1; }
.lpc-stat-value { font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; line-height: 1.2; margin-bottom: 4px; }
.lpc-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; line-height: 1.3; }

/* Follicular vs Luteal Chart */
.lpc-chart-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 20px;
}
.lpc-chart-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; }
.lpc-chart-bar { display: flex; height: 24px; border-radius: 100px; overflow: hidden; margin-bottom: 10px; }
.lpc-chart-seg { height: 100%; }
.lpc-seg-period { background: var(--pink); }
.lpc-seg-follicular { background: #F0D4EE; }
.lpc-seg-ovulation { background: var(--purple); }
.lpc-seg-luteal { background: #C9E4DB; }
.lpc-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.lpc-chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.lpc-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lpc-legend-period { background: var(--pink); }
.lpc-legend-follicular { background: #F0D4EE; }
.lpc-legend-ovulation { background: var(--purple); }
.lpc-legend-luteal { background: #C9E4DB; }
.lpc-chart-days { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); font-weight: 500; }

/* Symptoms Card */
.lpc-symptoms-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 20px;
}
.lpc-symptoms-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.lpc-symptoms-title svg { color: var(--pink); flex-shrink: 0; }
.lpc-symptoms-intro { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }
.lpc-symptoms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lpc-symptom-item { display: flex; gap: 8px; align-items: center; background: var(--grad-soft); border-radius: var(--radius-sm); padding: 8px 10px; }
.lpc-symptom-emoji { font-size: 16px; flex-shrink: 0; }
.lpc-symptom-name { font-size: 11.5px; font-weight: 700; color: var(--text); }

/* Luteal vs Pregnancy Compare Card */
.lpc-compare-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 20px;
}
.lpc-compare-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.lpc-compare-intro { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }
.lpc-compare-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px; }
.lpc-compare-row { display: grid; grid-template-columns: 1fr 1.1fr 1.1fr; gap: 8px; padding: 8px 10px; font-size: 10.5px; border-top: 1px solid var(--border); }
.lpc-compare-row:first-child { border-top: none; }
.lpc-compare-head { background: var(--grad-soft); font-weight: 800; color: var(--text); text-transform: uppercase; font-size: 9px; letter-spacing: 0.3px; }
.lpc-compare-row:not(.lpc-compare-head) div:first-child { font-weight: 700; color: var(--text); }
.lpc-compare-row:not(.lpc-compare-head) div:not(:first-child) { color: var(--text-muted); line-height: 1.4; }
.lpc-compare-row:nth-child(even):not(.lpc-compare-head) { background: #FAFAFF; }
.lpc-compare-note { font-size: 11px; color: var(--text-muted); line-height: 1.5; font-style: italic; }

/* Export Buttons */
.lpc-export-row { display: flex; gap: 12px; }
.lpc-export-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: var(--purple);
    cursor: pointer;
    transition: all 0.25s ease;
}
.lpc-export-btn:hover { border-color: var(--pink); background: var(--grad-soft); color: var(--pink); transform: translateY(-1px); }
.lpc-export-btn svg { flex-shrink: 0; }

/* ---- Footer ---- */
.lpc-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;
}
.lpc-footer svg { flex-shrink: 0; margin-top: 2px; color: var(--purple); }

/* ---- Mobile ---- */
@media (max-width: 560px) {
    .lpc-wrap { padding: 20px 10px; }
    .lpc-card { border-radius: var(--radius-lg); }
    .lpc-header { padding: 22px 20px; }
    .lpc-explainer-toggle { padding: 14px 20px; font-size: 12.5px; }
    .lpc-explainer-body { padding-left: 20px; padding-right: 20px; }
    .lpc-explainer-body.lpc-explainer-open { padding: 16px 20px; }
    .lpc-body { padding: 20px 20px 22px; gap: 20px; }
    .lpc-result { padding: 22px 20px; }
    .lpc-footer { padding: 14px 20px 20px; }
    .lpc-due-date { font-size: 24px; }
    .lpc-stats { gap: 8px; }
    .lpc-stat-value { font-size: 12px; }
    .lpc-stat-card { padding: 12px 8px; }
    .lpc-header-text h2 { font-size: 16.5px; }
    .lpc-export-row { flex-direction: column; }
    .lpc-symptoms-grid { grid-template-columns: 1fr; }
    .lpc-compare-row { grid-template-columns: 1fr; gap: 2px; }
    .lpc-compare-row:not(.lpc-compare-head) div:not(:first-child)::before { content: attr(data-label) ": "; }
    .lpc-history-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .lpc-history-item-load { align-self: flex-end; }
}
