/* Fernomi Share Page Styles */

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

:root {
    --bg: #0A1A0A;
    --card-bg: #0F2A0F;
    --accent: #81FC52;
    --accent-dark: #6AD943;
    --text-primary: #FFFFFF;
    --text-secondary: #7A8A7A;
    --menstrual: #FF6B6B;
    --follicular: #81FC52;
    --ovulation: #FFD93D;
    --luteal: #B088F9;
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.04);
}

html, body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    min-height: 100vh;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* Loading */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    color: var(--text-secondary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 12px;
}

.fern-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 18px;
}

.fern-logo svg {
    width: 30px;
    height: 30px;
}

.greeting {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    padding: 0 8px;
}

/* Welcome page only — kept for the no-data landing */
.greeting-sub {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
}

/* Phase Card */
.phase-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 22px 20px;
    margin-bottom: 16px;
    text-align: center;
}

.phase-emoji {
    font-size: 36px;
    margin-bottom: 8px;
}

.phase-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.phase-day {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.days-to-next {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(129, 252, 82, 0.1);
    color: var(--accent);
}

/* Support Card — single card replacing 3 pillar cards + avoid */
.support-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px 20px 18px;
    margin-bottom: 16px;
}

.support-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.support-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.support-row:last-of-type {
    border-bottom: none;
}

.support-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
    box-shadow: 0 0 12px currentColor;
}

.nurture-dot { background: var(--luteal); color: var(--luteal); }
.flow-dot { background: var(--accent); color: var(--accent); }
.nourish-dot { background: var(--ovulation); color: var(--ovulation); }

.support-row-content {
    flex: 1;
    min-width: 0;
}

.support-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

.support-text {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.avoid-note {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(255, 107, 107, 0.06);
    border-left: 2px solid rgba(255, 107, 107, 0.4);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
    font-style: italic;
}

.avoid-note::before {
    content: "Avoid: ";
    font-weight: 700;
    font-style: normal;
    color: var(--menstrual);
    letter-spacing: 0.3px;
}

/* Quick ideas — merged bring + actions chips */
.quick-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 24px;
}

.quick-card h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(129, 252, 82, 0.08);
    border: 1px solid rgba(129, 252, 82, 0.2);
    color: var(--accent);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.chip.action {
    background: rgba(176, 136, 249, 0.08);
    border-color: rgba(176, 136, 249, 0.2);
    color: var(--luteal);
}

/* Mood Snapshot */
.mood-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
}

.mood-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
}

.mood-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.mood-row:last-child {
    margin-bottom: 0;
}

.mood-label {
    width: 70px;
    font-size: 13px;
    color: var(--text-secondary);
}

.mood-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
    margin: 0 12px;
}

.mood-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.4s ease;
}

.mood-bar-fill.mood {
    background: linear-gradient(90deg, var(--luteal), var(--accent));
}

.mood-bar-fill.energy {
    background: linear-gradient(90deg, var(--ovulation), var(--accent));
}

.mood-bar-fill.stress {
    background: linear-gradient(90deg, var(--accent), var(--menstrual));
}

.mood-value {
    font-size: 14px;
    font-weight: 700;
    width: 30px;
    text-align: right;
}

/* Journal Note */
.journal-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
}

.journal-card h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.journal-text {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

/* Chat with Fernomi */
.chat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 24px;
}

.chat-header {
    margin-bottom: 14px;
}

.chat-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.chat-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.chat-messages {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.chat-messages:empty {
    display: none;
}

.chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble-user {
    align-self: flex-end;
    background: rgba(129, 252, 82, 0.12);
    border: 1px solid rgba(129, 252, 82, 0.25);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.chat-bubble-assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
    border-bottom-left-radius: 4px;
}

.chat-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: chat-bounce 1.4s infinite ease-in-out both;
}

.chat-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes chat-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.chat-chip {
    background: rgba(129, 252, 82, 0.08);
    border: 1px solid rgba(129, 252, 82, 0.2);
    color: var(--accent);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.chat-chip:hover, .chat-chip:focus {
    background: rgba(129, 252, 82, 0.18);
    outline: none;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    padding: 10px 16px;
    outline: none;
    transition: border-color 0.15s ease;
}

#chat-input::placeholder {
    color: var(--text-secondary);
}

#chat-input:focus {
    border-color: rgba(129, 252, 82, 0.4);
}

#chat-send {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

#chat-send:hover {
    background: var(--accent-dark);
}

#chat-send svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer p {
    margin-bottom: 2px;
}

.footer .small {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 6px;
}

/* Expired State */
.expired {
    text-align: center;
    padding: 60px 20px;
}

.expired-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.expired h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.expired p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Error State */
.error {
    text-align: center;
    padding: 60px 20px;
    color: var(--menstrual);
}
