/* ============================================
   Plantalya Light — Styles
   3 widgets: Symptom Checker, Photo Scan, Button
   ============================================ */
[x-cloak] { display: none !important; }

:root {
    --pl-green-dark: #1B3B2D;
    --pl-green: #2D5A3F;
    --pl-green-light: #8DB580;
    --pl-green-lighter: #e8f5e2;
    --pl-green-pale: #f0f7ed;
    --pl-text: #1e293b;
    --pl-text-light: #64748b;
    --pl-text-muted: #94a3b8;
    --pl-border: #e2e8f0;
    --pl-bg: #ffffff;
    --pl-radius: 12px;
    --pl-radius-sm: 8px;
    --pl-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --pl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =========================================
   Shared Button
   ========================================= */
.plantalya-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--pl-green);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--pl-font);
    box-sizing: border-box;
}
.plantalya-btn:hover { background: var(--pl-green-dark); }

/* =========================================
   Symptom Checker
   ========================================= */
.plantalya-symptoms {
    background: var(--pl-bg);
    border: 1px solid var(--pl-border);
    border-radius: var(--pl-radius);
    padding: 24px;
    margin: 32px 0;
    position: relative;
    overflow: hidden;
    font-family: var(--pl-font);
}
.plantalya-symptoms-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--pl-text);
}
.plantalya-symptoms-desc {
    font-size: 14px;
    color: var(--pl-text-light);
    margin-bottom: 16px;
}
.plantalya-symptoms-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.plantalya-symptom-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid var(--pl-border);
    border-radius: var(--pl-radius-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    font-size: 14px;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.plantalya-symptom-item:hover {
    border-color: var(--pl-green-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(141,181,128,0.15);
}
.plantalya-symptom-item:active { transform: scale(0.98); }
.plantalya-symptom-item.checked {
    border-color: var(--pl-green);
    background: var(--pl-green-pale);
    animation: pl-symptom-pop 0.4s cubic-bezier(.4,0,.2,1);
}
/* Ripple ring on check */
.plantalya-symptom-item.checked::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--pl-green);
    animation: pl-ripple-out 0.6s ease-out forwards;
    pointer-events: none;
}
.plantalya-symptom-text {
    flex: 1;
    font-size: 14px;
    color: var(--pl-text);
    line-height: 1.4;
}
.plantalya-symptom-badge {
    font-size: 10px;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.plantalya-symptom-check {
    width: 20px; height: 20px;
    border: 2px solid var(--pl-border);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
.plantalya-symptom-item.checked .plantalya-symptom-check {
    background: var(--pl-green);
    border-color: var(--pl-green);
    animation: pl-check-bounce 0.4s cubic-bezier(.4,0,.2,1);
}
.plantalya-symptom-item.checked .plantalya-symptom-check::after {
    content: '';
    position: absolute;
    left: 5px; top: 2px;
    width: 6px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: pl-checkmark-draw 0.3s ease-out 0.1s both;
}

/* Symptom checker animations */
@keyframes pl-symptom-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.03); }
    100% { transform: scale(1); }
}
@keyframes pl-ripple-out {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.08); }
}
@keyframes pl-check-bounce {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
@keyframes pl-checkmark-draw {
    0% { opacity: 0; transform: rotate(45deg) scale(0); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

@media (max-width: 600px) {
    .plantalya-symptoms-list { grid-template-columns: 1fr; }
}

/* Result section */
.plantalya-symptoms-result {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--pl-border);
}
.plantalya-symptoms-msg {
    font-size: 14px;
    margin-bottom: 12px;
    animation: pl-fade-slide-up 0.4s ease-out;
}
.plantalya-symptoms-low { color: var(--pl-text-light); }
.plantalya-symptoms-medium { color: #9a3412; font-weight: 500; }
.plantalya-symptoms-high { color: #dc2626; font-weight: 600; animation: pl-urgency-pulse 1.5s ease-in-out infinite; }

/* CTA button — default (0 checks) = green with bounce */
.plantalya-symptoms-result .plantalya-btn {
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--pl-green), var(--pl-green-dark));
    box-shadow: 0 4px 15px rgba(45,90,63,0.3);
    animation: pl-glow-soft 2s ease-in-out infinite, pl-btn-bounce 2.5s ease-in-out 1s infinite;
}
/* Shimmer on all CTA buttons */
.plantalya-symptoms-result .plantalya-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: pl-btn-shimmer 3s ease-in-out infinite;
}
@keyframes pl-btn-shimmer {
    0% { left: -100%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

/* Level 1 (1 check): orange gradient + shake */
.plantalya-symptoms--level-1 .plantalya-symptoms-result .plantalya-btn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 4px 20px rgba(249,115,22,0.4);
    animation: pl-glow-orange 1.5s ease-in-out infinite, pl-btn-shake 0.6s ease-in-out 1.5s infinite;
    transform: scale(1.03);
    font-size: 16px;
}
/* Level 2 (2 checks): red gradient + urgent shake + ring pulse */
.plantalya-symptoms--level-2 .plantalya-symptoms-result .plantalya-btn {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    box-shadow: 0 4px 25px rgba(220,38,38,0.5);
    animation: pl-glow-urgent 1s ease-in-out infinite, pl-btn-shake 0.5s ease-in-out 1s infinite;
    transform: scale(1.06);
    font-size: 17px;
    letter-spacing: 0.03em;
}
/* Ring pulse behind urgent button (level 2) */
.plantalya-symptoms--level-2 .plantalya-symptoms-result .plantalya-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    border: 2px solid rgba(220,38,38,0.4);
    animation: pl-ring-pulse 1.5s ease-out infinite;
    pointer-events: none;
}

/* Level 3 (3+ checks): dark red, intense glow */
.plantalya-symptoms--level-3 .plantalya-symptoms-result .plantalya-btn {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: #fff !important;
    box-shadow: 0 4px 30px rgba(220,38,38,0.5);
    animation: pl-glow-critical 1s ease-in-out infinite;
    transform: scale(1.08);
    font-size: 17px;
    letter-spacing: 0.03em;
}
.plantalya-symptoms--level-3 .plantalya-symptoms-result .plantalya-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    border: 2px solid rgba(220,38,38,0.5);
    animation: pl-ring-pulse 1.2s ease-out infinite;
    pointer-events: none;
}

/* Progress bar */
.plantalya-symptoms-progress {
    height: 8px;
    background: linear-gradient(90deg, #e8f5e2 0%, #d4edda 50%, #e8f5e2 100%);
    border-radius: 20px;
    margin-top: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.plantalya-symptoms-progress-bar {
    height: 100%;
    border-radius: 20px;
    transition: width 0.6s cubic-bezier(.4,0,.2,1), background 0.5s ease;
    position: relative;
    background: linear-gradient(90deg, #4ade80, #22c55e, #16a34a) !important;
}
/* Animated shine on progress bar */
.plantalya-symptoms-progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: -50%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: pl-shine 2s ease-in-out infinite;
}
@keyframes pl-shine {
    0% { left: -50%; }
    100% { left: 150%; }
}
/* Progress bar color per level */
.plantalya-symptoms--level-1 .plantalya-symptoms-progress-bar {
    background: linear-gradient(90deg, #fb923c, #f97316, #ea580c) !important;
}
.plantalya-symptoms--level-2 .plantalya-symptoms-progress-bar {
    background: linear-gradient(90deg, #f87171, #ef4444, #dc2626) !important;
}
.plantalya-symptoms--level-3 .plantalya-symptoms-progress-bar {
    background: linear-gradient(90deg, #ef4444, #dc2626, #991b1b) !important;
}

/* ---- Animations ---- */
@keyframes pl-fade-slide-up {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes pl-urgency-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes pl-glow-soft {
    0%, 100% { box-shadow: 0 4px 15px rgba(45,90,63,0.3), 0 0 0 0 rgba(45,90,63,0.4); }
    50% { box-shadow: 0 4px 15px rgba(45,90,63,0.3), 0 0 15px 5px rgba(45,90,63,0.15); }
}
@keyframes pl-glow-orange {
    0%, 100% { box-shadow: 0 4px 20px rgba(249,115,22,0.4), 0 0 0 0 rgba(249,115,22,0.5); }
    50% { box-shadow: 0 4px 20px rgba(249,115,22,0.4), 0 0 25px 8px rgba(249,115,22,0.2); }
}
@keyframes pl-glow-urgent {
    0%, 100% { box-shadow: 0 4px 25px rgba(220,38,38,0.5), 0 0 0 0 rgba(220,38,38,0.6); }
    50% { box-shadow: 0 4px 25px rgba(220,38,38,0.5), 0 0 35px 10px rgba(220,38,38,0.3); }
}
@keyframes pl-glow-critical {
    0%, 100% { box-shadow: 0 4px 30px rgba(220,38,38,0.5), 0 0 0 0 rgba(153,27,27,0.6); }
    50% { box-shadow: 0 4px 30px rgba(220,38,38,0.5), 0 0 40px 12px rgba(220,38,38,0.3); }
}
@keyframes pl-btn-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes pl-btn-shake {
    0%, 100% { transform: scale(1.06) translateX(0); }
    20% { transform: scale(1.06) translateX(-3px); }
    40% { transform: scale(1.06) translateX(3px); }
    60% { transform: scale(1.06) translateX(-2px); }
    80% { transform: scale(1.06) translateX(2px); }
}
@keyframes pl-ring-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.15); opacity: 0; }
}

/* ---- Level 3: PANIC MODE (3+ checks) ---- */

/* Box shake on trigger */
.plantalya-symptoms--shake {
    animation: pl-box-shake 0.6s cubic-bezier(.36,.07,.19,.97) both !important;
}
@keyframes pl-box-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-6px) rotate(-0.5deg); }
    20% { transform: translateX(5px) rotate(0.5deg); }
    30% { transform: translateX(-4px) rotate(-0.3deg); }
    40% { transform: translateX(4px) rotate(0.3deg); }
    50% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
}

/* Panic border pulse */
.plantalya-symptoms--level-3 {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 0 rgba(239,68,68,0.4);
    animation: pl-panic-border 2s ease-in-out infinite;
}
@keyframes pl-panic-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 20px 4px rgba(239,68,68,0.15); }
}

/* Red vignette (stays while level-3 active) */
.plantalya-symptoms--level-3::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 60px 20px rgba(220,38,38,0.12);
    pointer-events: none;
    z-index: 5;
    animation: pl-vignette-pulse 3s ease-in-out infinite;
}
@keyframes pl-vignette-pulse {
    0%, 100% { box-shadow: inset 0 0 60px 20px rgba(220,38,38,0.1); }
    50% { box-shadow: inset 0 0 80px 30px rgba(220,38,38,0.2); }
}

/* Counter badge */
.plantalya-symptoms-panic {
    animation: pl-panic-appear 0.5s cubic-bezier(.4,0,.2,1);
}
.plantalya-symptoms-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 15px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 50px;
    margin-bottom: 10px;
    animation: pl-counter-pulse 1.5s ease-in-out infinite;
}
.plantalya-symptoms-counter svg {
    flex-shrink: 0;
    animation: pl-warning-bounce 1s ease-in-out infinite;
}
@keyframes pl-warning-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
@keyframes pl-counter-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.2); }
    50% { box-shadow: 0 0 12px 4px rgba(220,38,38,0.15); }
}
@keyframes pl-panic-appear {
    0% { opacity: 0; transform: translateY(12px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Critical message */
.plantalya-symptoms-critical {
    color: #b91c1c;
    font-weight: 700;
    font-size: 15px;
}

/* Red flash overlay */
.plantalya-symptoms-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(220,38,38,.4) 0%, rgba(153,27,27,.25) 40%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    border-radius: inherit;
}
.plantalya-symptoms-flash--active {
    animation: pl-flash .8s ease-out forwards;
}
@keyframes pl-flash {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); }
}

/* Shockwave ring from button */
.plantalya-symptoms-shockwave {
    position: absolute;
    border-radius: 50%;
    border: 3px solid rgba(220,38,38,0.5);
    pointer-events: none;
    z-index: 11;
    opacity: 0;
    transform: translate(-50%,-50%);
}
.plantalya-symptoms-shockwave--active {
    animation: pl-shockwave .9s cubic-bezier(0,.4,.4,1) forwards;
}
@keyframes pl-shockwave {
    0% { width: 40px; height: 40px; opacity: .7; border-width: 3px; }
    100% { width: 500px; height: 500px; opacity: 0; border-width: 1px; }
}

/* =========================================
   Photo Diagnosis Teaser
   ========================================= */
.plantalya-scan {
    background: var(--pl-green-dark);
    border-radius: var(--pl-radius);
    overflow: hidden;
    margin: 32px 0;
    font-family: var(--pl-font);
}
.plantalya-scan-viewfinder {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(27,59,45,0.95), rgba(27,59,45,0.7));
    -webkit-tap-highlight-color: transparent;
}
.plantalya-scan-corners {
    position: absolute;
    inset: 20px;
}
.plantalya-scan-corners .corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: rgba(255,255,255,0.5);
    border-style: solid;
    border-width: 0;
}
.corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }
.plantalya-scan-center {
    position: relative;
    z-index: 1;
    animation: pl-scan-pulse 2s ease-in-out infinite;
}
@keyframes pl-scan-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}
.plantalya-scan-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.plantalya-scan-reveal {
    padding: 24px;
    text-align: center;
}
.plantalya-scan-msg {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px;
}
.plantalya-scan .plantalya-btn {
    background: var(--pl-green-light);
    color: var(--pl-green-dark);
}
.plantalya-scan .plantalya-btn:hover {
    background: #a3cc96;
}
