/* ============================================
   DUE DATE & GESTATION CALCULATOR - CSS
   Version 1.0
============================================ */

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

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

.ddgc-wrap {
    --teal:        #0D9488;
    --teal-dark:   #0B7A70;
    --sage:        #52B788;
    --peach:       #E6F2F0;
    --amber:       #E8A33D;
    --red:         #E0554F;
    --grad:        linear-gradient(135deg, #0D9488 0%, #14B8A6 100%);
    --grad-soft:   rgba(13,148,136,0.08);
    --white:       #FFFFFF;
    --bg:          #F2F7F6;
    --card-bg:     #FFFFFF;
    --border:      rgba(13,148,136,0.14);
    --text:        #0F2A3D;
    --text-muted:  #5C7A80;
    --shadow-card: 0 32px 80px rgba(15,42,61,0.16), 0 8px 24px rgba(13,148,136,0.10);
    --shadow-btn:  0 12px 32px rgba(13,148,136,0.40);
    --radius-xl:   28px;
    --radius-lg:   20px;
    --radius-md:   14px;
    --radius-sm:   10px;
    font-family: 'Jost', sans-serif;
    position: relative;
    padding: 32px 20px 60px;
    background: var(--bg);
    min-height: 100%;
    color: var(--text);
}

.ddgc-blob { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; }
.ddgc-blob-1 { width: 420px; height: 420px; background: rgba(13,148,136,0.14); top: -120px; left: -120px; }
.ddgc-blob-2 { width: 360px; height: 360px; background: rgba(15,42,61,0.10); bottom: 0; right: -120px; }

.ddgc-card { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }

/* ---- Header ---- */
.ddgc-header { background: var(--grad); border-radius: var(--radius-xl); padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-card); margin-bottom: 20px; }
.ddgc-header::after { content: ''; position: absolute; width: 280px; height: 280px; background: rgba(255,255,255,0.10); border-radius: 50%; top: -110px; right: -70px; }
.ddgc-header-left { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.ddgc-header-icon { width: 52px; height: 52px; background: rgba(255,255,255,0.20); 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.3); }
.ddgc-header-text h1 { color: #fff; font-family: 'Jost', sans-serif; font-size: 21px; font-weight: 700; letter-spacing: -0.3px; background: none; -webkit-text-fill-color: initial; }
.ddgc-header-text p { color: rgba(255,255,255,0.85); font-size: 12px; margin-top: 4px; }
.ddgc-icon-btn { width: 40px; height: 40px; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; position: relative; z-index: 1; transition: background 0.2s; }
.ddgc-icon-btn:hover { background: rgba(255,255,255,0.28); }

/* ---- History panel ---- */
.ddgc-history-panel { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.ddgc-history-panel.ddgc-history-open { max-height: 420px; overflow-y: auto; margin-bottom: 20px; }
.ddgc-history-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; font-size: 13px; font-weight: 800; color: var(--text); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card-bg); }
.ddgc-history-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; line-height: 1; }
.ddgc-history-list { padding: 14px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.ddgc-history-empty { font-size: 13px; color: var(--text-muted); padding: 20px 0; text-align: center; }
.ddgc-history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; cursor: pointer; }
.ddgc-history-item:hover { border-color: var(--teal); }
.ddgc-history-item-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.ddgc-history-item-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.ddgc-history-item-btn { border: 1.5px solid var(--border); background: var(--white); color: var(--red); font-family: 'Jost', sans-serif; font-size: 11.5px; font-weight: 700; border-radius: 7px; padding: 6px 11px; cursor: pointer; flex-shrink: 0; }

/* ---- Explainer ---- */
.ddgc-explainer { background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden; }
.ddgc-explainer-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--grad-soft); border: none; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--text); font-family: 'Jost', sans-serif; }
.ddgc-explainer-toggle svg { color: var(--teal); transition: transform 0.25s ease; flex-shrink: 0; }
#ddgc_explainer_arrow.ddgc-explainer-arrow-open { transform: rotate(180deg); }
.ddgc-explainer-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; padding: 0 24px; }
.ddgc-explainer-body.ddgc-explainer-open { max-height: 420px; padding: 16px 24px; }
.ddgc-explainer-body p { font-size: 12.5px; color: var(--text-muted); line-height: 1.65; margin-bottom: 10px; }
.ddgc-explainer-body p:last-child { margin-bottom: 0; }
.ddgc-explainer-body strong { color: var(--text); }

/* ---- Fields ---- */
.ddgc-panel { background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); border: 1px solid var(--border); padding: 26px 28px; margin-bottom: 20px; }
.ddgc-field { margin-bottom: 16px; }
.ddgc-field:last-child { margin-bottom: 0; }
.ddgc-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.4px; }
.ddgc-input {
    width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 11px 12px; font-family: 'Jost', sans-serif; font-size: 13.5px; font-weight: 600; color: var(--text);
    background: var(--white); outline: none; transition: border-color 0.2s; cursor: pointer;
}
.ddgc-input:focus { border-color: var(--teal); }

/* ---- Mode tabs ---- */
.ddgc-mode-tabs { display: flex; gap: 6px; background: var(--peach); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px; margin-bottom: 16px; }
.ddgc-mode-tab { flex: 1; background: none; border: none; color: var(--teal-dark); font-family: 'Jost', sans-serif; font-size: 12px; font-weight: 700; border-radius: var(--radius-sm); padding: 10px 8px; cursor: pointer; }
.ddgc-mode-tab:hover { color: var(--teal); }
.ddgc-mode-tab.ddgc-mode-active { background: var(--grad); color: #fff; }

/* ---- Error ---- */
.ddgc-error { margin-top: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(224,85,79,0.1); border: 1.5px solid rgba(224,85,79,0.3); color: var(--red); font-size: 12.5px; font-weight: 600; line-height: 1.5; }

/* ---- Result ---- */
.ddgc-result { background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); border: 1px solid var(--border); padding: 26px 28px; }
.ddgc-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ddgc-result-badge { font-size: 13px; font-weight: 800; color: var(--text); }
.ddgc-input-recap { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.ddgc-input-recap:empty { display: none; margin: 0; }

.ddgc-due-card { background: var(--grad); border-radius: var(--radius-lg); padding: 24px; text-align: center; margin-bottom: 18px; position: relative; overflow: hidden; }
.ddgc-due-card::after { content: ''; position: absolute; width: 180px; height: 180px; background: rgba(255,255,255,0.10); border-radius: 50%; top: -80px; right: -50px; }
.ddgc-due-label { color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; position: relative; }
.ddgc-due-value { color: #fff; font-family: 'Jost', sans-serif; font-size: 30px; font-weight: 700; letter-spacing: -0.5px; margin: 8px 0; position: relative; word-break: break-word; background: none; -webkit-text-fill-color: initial; }
.ddgc-due-sub { color: rgba(255,255,255,0.9); font-size: 12px; font-weight: 500; position: relative; }

/* ---- Progress bar ---- */
.ddgc-progress-card { margin-bottom: 18px; }
.ddgc-progress-bar { width: 100%; height: 12px; border-radius: 100px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.ddgc-progress-fill { height: 100%; width: 0%; background: var(--grad); border-radius: 100px; transition: width 0.4s ease; }
.ddgc-progress-label { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-muted); margin-top: 8px; }

.ddgc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.ddgc-stats:empty { display: none; margin-bottom: 0; }
.ddgc-stat-card { background: var(--bg); border-radius: var(--radius-md); padding: 14px; text-align: center; border: 1px solid var(--border); }
.ddgc-stat-icon { font-size: 16px; margin-bottom: 4px; }
.ddgc-stat-value { font-size: 15.5px; font-weight: 800; color: var(--text); word-break: break-word; }
.ddgc-stat-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }

/* ---- Milestones ---- */
.ddgc-milestones-card { background: var(--bg); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 16px; margin-bottom: 14px; }
.ddgc-milestones-title { font-size: 12.5px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.ddgc-milestones { display: flex; flex-direction: column; gap: 8px; }
.ddgc-milestone { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--border); font-size: 12.5px; color: var(--text); }
.ddgc-milestone.ddgc-milestone-past { opacity: 0.5; }
.ddgc-milestone.ddgc-milestone-current { border-color: var(--teal); background: var(--grad-soft); }
.ddgc-milestone-date { font-weight: 700; color: var(--teal-dark); font-variant-numeric: tabular-nums; }

.ddgc-actions-row { margin-bottom: 10px; }
.ddgc-save-btn { width: 100%; background: var(--grad); color: #fff; border: none; font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 800; border-radius: var(--radius-md); padding: 14px; cursor: pointer; box-shadow: var(--shadow-btn); }
.ddgc-export-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.ddgc-export-btn { background: var(--white); border: 1.5px solid var(--border); color: var(--text); font-family: 'Jost', sans-serif; font-size: 12px; font-weight: 700; border-radius: var(--radius-sm); padding: 11px 6px; cursor: pointer; }
.ddgc-export-btn:hover { border-color: var(--teal); color: var(--teal); }

.ddgc-footer-note { font-size: 10.5px; color: var(--text-muted); text-align: center; line-height: 1.5; }

/* ---- Responsive ---- */
@media (max-width: 780px) {
    .ddgc-stats { grid-template-columns: 1fr 1fr; }
    .ddgc-mode-tabs { flex-direction: column; }
}
