/* Write to Power Portal Styles
 * Addon-specific styles that complement mcb_website shared components.
 * Brand color: var(--wtp-primary) (#1e40af indigo)
 */

/* ── Topic Grid (Landing Page) ───────────────────────────────────── */
.wtp-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 991px) {
    .wtp-topic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .wtp-topic-grid {
        grid-template-columns: 1fr;
    }
}

.wtp-topic-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--wtp-radius-lg);
    border: 2px solid var(--wtp-border);
    background: var(--wtp-bg-white);
    color: var(--wtp-text-heading);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
}

.wtp-topic-card:hover {
    border-color: var(--wtp-primary);
    box-shadow: 0 4px 16px var(--wtp-primary-alpha-15);
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--wtp-text-heading);
}

/* Arrow affordance on hover */
.wtp-topic-card::after {
    content: '\f054';
    font-family: FontAwesome;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.7rem;
    color: var(--wtp-border-light);
    transition: all 0.2s ease;
}

.wtp-topic-card:hover::after {
    color: var(--wtp-primary);
    transform: translateX(2px);
}

/* Focus-visible for keyboard navigation */
.wtp-topic-card:focus-visible {
    outline: 3px solid var(--wtp-primary);
    outline-offset: 2px;
    border-color: var(--wtp-primary);
    box-shadow: 0 4px 16px var(--wtp-primary-alpha-15);
}

.wtp-topic-card.selected {
    border-color: var(--wtp-primary);
    background: var(--wtp-selected-bg);
    box-shadow: 0 0 0 3px var(--wtp-primary-alpha-15);
}

.wtp-topic-icon-wrap {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wtp-selected-bg) 0%, var(--wtp-selected-bg-hover) 100%);
    color: var(--wtp-primary);
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.wtp-topic-card:hover .wtp-topic-icon-wrap {
    background: linear-gradient(135deg, var(--wtp-selected-bg-hover) 0%, var(--wtp-selected-bg-deep) 100%);
    transform: scale(1.05);
}

.wtp-topic-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.wtp-topic-subtitle {
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--wtp-text-secondary);
}

/* ── Recipient recommendation cards ──────────────────────────────── */
.wtp-recipient-rec-card {
    border: 2px solid var(--wtp-border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wtp-recipient-rec-card:hover {
    border-color: var(--wtp-primary);
    box-shadow: 0 2px 8px var(--wtp-primary-alpha-10);
}

.wtp-recipient-rec-card.selected {
    border-color: var(--wtp-primary);
    background: var(--wtp-selected-bg);
}

/* ── Context chips (step 3) ──────────────────────────────────────── */
.wtp-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: var(--wtp-selected-bg);
    color: var(--wtp-primary);
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── MP Prompt chips ──────────────────────────────────────────────── */
.wtp-prompt-chip {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--wtp-radius-md);
    border: 1px solid var(--wtp-border);
    background: var(--wtp-bg-white);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.wtp-prompt-chip:hover {
    border-color: var(--wtp-primary);
    background: var(--wtp-selected-bg);
}

.wtp-prompt-chip.selected {
    border-color: var(--wtp-primary);
    background: var(--wtp-selected-bg-hover);
}

/* ── Also-write-to panel ──────────────────────────────────────────── */
.wtp-also-write-card {
    border: 2px solid var(--wtp-border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.wtp-also-write-card:hover {
    border-color: var(--wtp-primary);
    background: var(--wtp-selected-bg);
}

/* ── Step Preview Strip (Landing Page) ────────────────────────────── */
.wtp-step-pill {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--wtp-bg-light);
    color: var(--wtp-text-secondary);
    border: 1px solid var(--wtp-border);
}

.wtp-step-pill.active {
    background: var(--wtp-primary);
    color: var(--wtp-bg-white);
    border-color: var(--wtp-primary);
}

/* ── Trust Bar ───────────────────────────────────────────────────── */
.wtp-trust-bar {
    background: var(--wtp-bg-light);
}

/* ── Step Indicator Enhancements (Compose Wizard) ────────────────── */
.progress-step.active .step-number {
    box-shadow: 0 0 0 4px var(--wtp-primary-alpha-15);
}

.progress-step.completed .step-number {
    font-size: 0;
}

.progress-step.completed .step-number::after {
    content: '\f00c';
    font-family: FontAwesome;
    font-size: 0.85rem;
}

/* ── Hero Badge Contrast Enhancement ─────────────────────────────── */
.mcb-hero .mcb-hero-badge {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ── Islamic Geometric Pattern Overlay ───────────────────────────── */
.mcb-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M30 0l30 30-30 30L0 30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ── Recipient Rec Card Focus ────────────────────────────────────── */
.wtp-recipient-rec-card:focus-visible,
.wtp-also-write-card:focus-visible,
.wtp-prompt-chip:focus-visible {
    outline: 3px solid var(--wtp-primary);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .wtp-topic-card,
    .wtp-mp-search-item,
    .wtp-recipient-rec-card,
    .wtp-prompt-chip,
    .wtp-also-write-card,
    .wtp-topic-icon-wrap {
        transition: none;
    }

    .wtp-topic-card:hover {
        transform: none;
    }

    .wtp-topic-card:hover .wtp-topic-icon-wrap {
        transform: none;
    }

    .wtp-topic-card:hover::after {
        transform: none;
    }
}

/* ===== Container Width Constraint ===== */
.wtp-container-narrow {
    max-width: 900px;
}