/* =============================================================
   PCOS Awareness & Self-Assessment System — Custom CSS
   (Supplements Tailwind CDN)
   ============================================================= */

/* ── Google Font fallback ── */
body { font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; }

/* ── Safe area insets for notched phones ── */
.safe-area-top    { padding-top:    env(safe-area-inset-top, 0px); }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ── Page gradient background ── */
.page-bg {
    background: linear-gradient(135deg, #fce7f3 0%, #ffffff 50%, #f3e8ff 100%);
    min-height: 100vh;
}

/* ── Cards ── */
.card {
    background: #ffffff;
    border-radius: 1.25rem;
    border: 1px solid rgba(236, 72, 153, 0.12);
    box-shadow: 0 4px 24px rgba(236, 72, 153, 0.07), 0 1px 6px rgba(0,0,0,0.04);
    padding: 1.5rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover {
    box-shadow: 0 8px 32px rgba(236, 72, 153, 0.1), 0 2px 12px rgba(0,0,0,0.06);
}

/* ── Collapsible Sections ── */
.collapsible-section {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.section-header {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    outline: none;
}

.section-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.section-header:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.section-header svg {
    transition: transform 0.3s ease;
}

.section-content {
    animation: slideDown 0.3s ease-out;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive improvements for collapsible sections */
@media (max-width: 640px) {
    .section-header {
        padding: 0.75rem 1rem !important;
    }
    
    .section-header .font-semibold {
        font-size: 0.875rem;
    }
    
    .section-header .text-xs {
        font-size: 0.75rem;
    }
}
.card-glow {
    box-shadow: 0 20px 60px rgba(236, 72, 153, 0.12), 0 4px 20px rgba(0,0,0,0.06);
}
.card-soft {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(236, 72, 153, 0.08);
}

/* ── Buttons ── */
.btn-pink {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #fff;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-pink:hover  { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(236,72,153,0.4); }
.btn-pink:active { transform: translateY(0); }

.btn-outline-pink {
    border: 2px solid #ec4899;
    color: #ec4899;
    background: transparent;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s;
}
.btn-outline-pink:hover { background: #fdf2f8; transform: translateY(-1px); }

.btn-ghost {
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-ghost:hover { background: #f9fafb; border-color: #d1d5db; }

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
    border-radius: 0.65rem;
}

/* ── Form inputs ── */
.ifield {
    border: 1.5px solid #fce7f3;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: rgba(253, 242, 248, 0.3);
    color: #1f2937;
    outline: none;
}
.ifield:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.12);
}
.ifield-white {
    background: #fff;
    border-color: #e5e7eb;
}
.ifield-white:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.12);
}

/* ── Select styling ── */
select.ifield {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

/* ── Risk level badges ── */
.badge-low      { background:#dcfce7; color:#15803d; border:1px solid #86efac; }
.badge-moderate { background:#fef9c3; color:#a16207; border:1px solid #fde047; }
.badge-high     { background:#fee2e2; color:#dc2626; border:1px solid #fca5a5; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.03em;
}

/* ── Stat cards ── */
.stat-card {
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid rgba(236, 72, 153, 0.12);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 2px 12px rgba(236,72,153,0.07);
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 1.25rem 1.25rem 0 0;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(236,72,153,0.14); }

.stat-card-pink::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.stat-card-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card-orange::before { background: linear-gradient(90deg, #f97316, #fb923c); }
.stat-card-red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card-green::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card-purple::before { background: linear-gradient(90deg, #a855f7, #c084fc); }

/* ── Progress bar ── */
.progress-bar {
    height: 8px;
    border-radius: 9999px;
    background: #fce7f3;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #ec4899, #be185d);
    transition: width 0.6s ease;
}

/* ── Rating stars / scale buttons ── */
.scale-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 2px solid #fce7f3;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scale-btn:hover, .scale-btn.active {
    background: linear-gradient(135deg,#ec4899,#be185d);
    border-color: #ec4899;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(236,72,153,0.35);
}

/* ── Small scale button (for compact layouts) ── */
.scale-btn-sm {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.7rem;
}
.scale-btn-sm:hover, .scale-btn-sm.active {
    transform: scale(1.15);
}

/* ── Hidden input for scale fields ── */
.scale-hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* ── Chat bubble ── */
.bubble-sent {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #fff;
    border-radius: 1.25rem 1.25rem 0.25rem 1.25rem;
    padding: 0.625rem 1rem;
    max-width: 75%;
    font-size: 0.875rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(236,72,153,0.25);
}
.bubble-recv {
    background: #fff;
    color: #374151;
    border-radius: 1.25rem 1.25rem 1.25rem 0.25rem;
    padding: 0.625rem 1rem;
    max-width: 75%;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid #fce7f3;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Table ── */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th {
    background: #fdf2f8;
    color: #be185d;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #fce7f3;
}
.data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #fdf2f8;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: #fdf9fb; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table-striped tbody tr:nth-child(even) { background: #fef9fc; }
.data-table-striped tbody tr:nth-child(even):hover { background: #fdf2f8; }

/* ── Mini table (compact) ── */
.table-mini th { padding: 0.55rem 0.85rem; font-size: 0.6rem; }
.table-mini td { padding: 0.6rem 0.85rem; font-size: 0.8rem; }

/* ── Section heading ── */
.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}
.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}
.empty-state-text {
    color: #9ca3af;
    font-size: 0.875rem;
    max-width: 20rem;
    margin: 0 auto;
}

/* ── Scrollbar (webkit) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #f9a8d4; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #f472b6; }

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease forwards; }

@keyframes fadeInUpSlow {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up-slow { animation: fadeInUpSlow 0.5s ease forwards; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.slide-down { animation: slideDown 0.3s ease forwards; }

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.scale-in { animation: scaleIn 0.25s ease forwards; }

@keyframes pulse-pink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(236,72,153,0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(236,72,153,0); }
}
.pulse-pink { animation: pulse-pink 2s infinite; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer {
    background: linear-gradient(90deg, #fce7f3 25%, #fdf2f8 50%, #fce7f3 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
}

/* ── Stagger animation delays ── */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* ── Divider ── */
.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #fce7f3, transparent);
}

/* ── Timeline ── */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #fce7f3, #ec4899);
    border-radius: 9999px;
}
.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.35rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #ec4899;
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

/* ── Glass morphism ── */
.glass {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ── Gradient text ── */
.gradient-text {
    background: linear-gradient(135deg, #ec4899, #be185d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Tooltip ── */
.tooltip {
    position: relative;
}
.tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    font-size: 0.65rem;
    padding: 0.3rem 0.7rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.tooltip:hover::after { opacity: 1; }

/* ── Notification dot ── */
.notif-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
}
.notif-dot-red { background: #ef4444; }
.notif-dot-yellow { background: #eab308; }
.notif-dot-green { background: #22c55e; }

/* ── Alert severity bar ── */
.severity-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
}
.severity-critical { background: #fee2e2; color: #dc2626; }
.severity-high { background: #ffedd5; color: #ea580c; }
.severity-medium { background: #fef9c3; color: #a16207; }
.severity-low { background: #dcfce7; color: #15803d; }

/* ── Counter badge (number pill) ── */
.counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0 0.35rem;
}
.counter-badge-pink { background: #fce7f3; color: #be185d; }
.counter-badge-red { background: #fee2e2; color: #dc2626; }