/* ==========================================================================
   Palmistry Workbench - Bilingual "How to Use" Modal Styles
   Upgraded: High-Visibility Trigger Button + Tamil/English Readability
   Zero dependencies | Vanilla CSS (Grid, Flexbox, Custom Properties)
   ========================================================================== */

:root {
    --guide-bg: #ffffff;
    --guide-surface: #f8fafc;
    --guide-border: #cbd5e1;
    --guide-text-primary: #0f172a;
    --guide-text-secondary: #334155;
    --guide-accent: #d97706;
    --guide-accent-hover: #b45309;
    --guide-accent-soft: #fef3c7;
    --guide-font-stack: 'Noto Sans Tamil', 'Mukta Malar', 'Latha', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --guide-radius-lg: 16px;
    --guide-radius-md: 12px;
    --guide-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}

/* Strictly enforce single-language visibility */
[data-guide-lang][hidden] {
    display: none !important;
}

/* ==========================================================================
   HIGH-VISIBILITY ATTENTION TRIGGER BUTTON
   ========================================================================== */
.guide-trigger-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 999px;
    font-family: var(--guide-font-stack);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.45), 0 0 0 3px rgba(245, 158, 11, 0.25);
    animation: guideAttentionPulse 2.4s infinite ease-in-out;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.guide-trigger-btn svg {
    flex-shrink: 0;
    stroke: #ffffff;
    stroke-width: 2.4;
}

.guide-trigger-btn:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.06);
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.55), 0 0 0 4px rgba(245, 158, 11, 0.38);
    animation: none;
}

.guide-trigger-btn:active {
    transform: translateY(0) scale(0.99);
}

@keyframes guideAttentionPulse {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(234, 88, 12, 0.45), 0 0 0 0 rgba(245, 158, 11, 0.55);
    }
    50% {
        box-shadow: 0 6px 18px rgba(234, 88, 12, 0.55), 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* ==========================================================================
   NATIVE <dialog> MODAL CONTAINER & TYPOGRAPHY
   ========================================================================== */
.guide-modal {
    border: none;
    border-radius: var(--guide-radius-lg);
    padding: 0;
    width: min(95vw, 980px);
    max-height: 90vh;
    background-color: var(--guide-bg);
    color: var(--guide-text-primary);
    font-family: var(--guide-font-stack);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    box-shadow: var(--guide-shadow);
    overflow: hidden;
    margin: auto;
}

.guide-modal::backdrop {
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(5px);
}

.guide-modal[open] {
    display: flex;
    flex-direction: column;
    animation: guideModalFadeIn 0.22s ease-out;
}

@keyframes guideModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.guide-modal-container {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Sticky Header */
.guide-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.6rem;
    background-color: #fffbeb;
    border-bottom: 1.5px solid #fde68a;
}

.guide-header-titles h2 {
    margin: 0 0 0.35rem 0;
    font-size: clamp(1.2rem, 2.3vw, 1.55rem);
    font-weight: 700;
    line-height: 1.45;
    color: #78350f;
}

.guide-header-titles p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #451a03;
}

.guide-header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Language Toggle Pill */
.guide-lang-switch {
    display: inline-flex;
    background-color: #fde68a;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid #f59e0b;
}

.guide-lang-btn {
    border: none;
    background: transparent;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-family: var(--guide-font-stack);
    font-size: 0.92rem;
    font-weight: 700;
    color: #78350f;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.guide-lang-btn.is-active {
    background-color: #b45309;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

/* Close Button */
.guide-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background-color: #ffffff;
    color: var(--guide-text-primary);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.guide-close-btn:hover {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

/* Scrollable Body & 2-Column Step Grid */
.guide-modal-body {
    padding: 1.5rem 1.6rem;
    overflow-y: auto;
    flex: 1;
}

.guide-steps-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 740px) {
    .guide-steps-grid {
        grid-template-columns: 1fr;
    }

    .guide-modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .guide-header-controls {
        justify-content: space-between;
    }
}

/* Step Card */
.guide-step-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.2rem;
    background-color: var(--guide-surface);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--guide-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guide-step-card:hover {
    border-color: #f59e0b;
    background-color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.guide-step-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    background-color: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
}

.guide-step-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    background-color: var(--guide-accent-soft);
    color: #92400e;
    border: 1px solid #fcd34d;
    margin-bottom: 0.5rem;
}

.guide-step-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--guide-text-primary);
}

.guide-step-content p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.72;
    color: var(--guide-text-secondary);
}

.guide-step-content strong {
    color: #0f172a;
    font-weight: 700;
}

/* Sticky Footer */
.guide-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1.1rem 1.6rem;
    background-color: var(--guide-surface);
    border-top: 1px solid var(--guide-border);
}

.guide-primary-btn {
    padding: 0.75rem 1.6rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    font-family: var(--guide-font-stack);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.guide-primary-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}
