/* ============================================================
   VALIDATENICHE.COM — COMPONENTS STYLESHEET
   Niche result cards and dynamic UI components
   All colors reference CSS variables from styles.css
============================================================ */

/* ============================================================
   VALIDATION SCORE DISPLAY
============================================================ */
.validation-score {
    text-align: center;
    padding: 1rem 0 0.8rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.8rem;
}

.score-number {
    font-family: 'Archivo', sans-serif;
    font-size: 3.4rem;
    font-weight: 900;
    line-height: 1;
    color: var(--primary);
}

.score-denom {
    font-size: 1.1rem;
    color: var(--text-hint);
    font-weight: 400;
}

.score-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

/* Score colors by range */
.score-excellent { color: var(--green); }
.score-good      { color: var(--accent); }
.score-medium    { color: var(--yellow); }
.score-weak      { color: var(--red); }

/* Verdict display */
.score-verdict {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    margin-top: 0.3rem;
}

/* Signal line under score */
.signal-strip {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.7;
    margin: 0.5rem 0 0.8rem;
}

/* ============================================================
   METRICS GRID (inside niche cards)
============================================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0.8rem 0;
}

.metric {
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   NICHE CARD ACTION BUTTONS
============================================================ */
.btn-creation-plan {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    margin: 8px 0 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-creation-plan:hover { opacity: 0.9; color: white; }

/* ============================================================
   EXPANDABLE SECTIONS (strategy report)
============================================================ */
details { margin: 0.4rem 0; }

details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.65rem 0.9rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--primary);
    list-style: none;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    margin-bottom: 0.3rem;
}

details summary:hover {
    background: var(--bg);
    border-color: #C8D8E8;
}

details[open] summary {
    background: white;
    border-color: #C8D8E8;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.exp-icon {
    font-size: 0.82rem;
    color: var(--accent);
    transition: transform 0.25s ease;
    display: inline-block;
}

details[open] .exp-icon { transform: rotate(180deg); }

details > div {
    padding: 0.5rem 0.5rem 0.5rem;
}

/* ============================================================
   KEYWORD TAGS
============================================================ */
.keyword-tag {
    display: inline-block;
    background: white;
    border: 1px solid var(--border-mid);
    color: var(--accent-dark);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.77rem;
    font-weight: 500;
    margin: 2px;
    transition: var(--transition);
}

.keyword-tag:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ============================================================
   CARD FOOTER ACTIONS
============================================================ */
.card-action-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1.5px solid #E2E8F0;
}

.card-action-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1.5px solid #E2E8F0;
    background: white;
    color: #4A6070;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-family: inherit;
}

.card-action-btn:hover {
    background: #5BA8D4;
    color: white;
    border-color: #5BA8D4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91,168,212,0.25);
}

.card-action-btn.primary {
    background: #5BA8D4;
    color: white;
    border-color: #5BA8D4;
    font-size: 0.88rem;
}

.card-action-btn.primary:hover {
    background: #2E86C1;
    border-color: #2E86C1;
    box-shadow: 0 4px 12px rgba(46,134,193,0.3);
}

/* ============================================================
   FEEDBACK WIDGET
============================================================ */
.feedback-widget {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.feedback-label {
    font-size: 0.77rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.feedback-btns {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.feedback-btn {
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.77rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text-muted);
    transition: var(--transition);
}

.feedback-btn:hover { border-color: #C8D8E8; color: var(--accent-dark); }
.feedback-btn.selected-pos { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.feedback-btn.selected-neg { background: var(--red-bg); border-color: var(--red); color: var(--red); }

/* ============================================================
   TRENDING CONTEXT BANNER (shown when coming from trending page)
============================================================ */
.trending-context {
    grid-column: 1 / -1;
    background: var(--card);
    border: 2px solid var(--border-mid);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    margin-bottom: 0.5rem;
}

.trending-context-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.trending-context-info {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

/* ============================================================
   WHY IT WORKS SECTION
============================================================ */
.why-section {
    background: #F8F9FA;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin: 0.6rem 0;
    font-size: 0.83rem;
    color: var(--text-light);
    line-height: 1.65;
    border-left: 3px solid #C8D8E8;
}

/* ============================================================
   PLATFORM BADGE (on cards)
============================================================ */
.platform-badge {
    font-size: 0.77rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.3rem;
}

/* ============================================================
   REPORT LINK
============================================================ */
.report-btn {
    font-size: 0.72rem;
    color: var(--red);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-top: 0.3rem;
}

/* ============================================================
   NICHE CARD ACTION BUTTONS (used by createCardActions)
============================================================ */
.niche-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1.5px solid #E2E8F0;
}

.niche-action-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1.5px solid #E2E8F0;
    background: white;
    color: #4A6070;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.niche-action-btn:hover {
    background: #5BA8D4;
    color: white;
    border-color: #5BA8D4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91,168,212,0.3);
}

.niche-action-btn.primary-action {
    grid-column: 1 / -1;
    background: #5BA8D4;
    color: white;
    border-color: #5BA8D4;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.niche-action-btn.primary-action:hover {
    background: #2E86C1;
    border-color: #2E86C1;
    box-shadow: 0 6px 16px rgba(46,134,193,0.35);
    transform: translateY(-2px);
}


/* ============================================================
   MOBILE — Niche Cards & Results
============================================================ */
@media (max-width: 768px) {
    .niche-card {
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
    }
    .niche-card-body {
        padding: 1rem !important;
    }
    .results-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 0.5rem !important;
    }
    /* Score display */
    .niche-card-body > div[style*="3.4rem"] {
        font-size: 2.8rem !important;
    }
    /* Build plan steps on mobile */
    .build-plan-section {
        margin: 0.75rem 0 !important;
    }
    .build-plan-section div[style*="grid-template-columns:28px"] {
        grid-template-columns: 24px 1fr !important;
        gap: 8px !important;
    }
    .build-plan-section a[style*="background:#1A3A52"],
    .build-plan-section span[style*="border:1px solid #E2E8F0"] {
        font-size: 0.7rem !important;
        padding: 4px 7px !important;
        white-space: nowrap !important;
    }
    /* Income banner in build plan */
    .build-plan-section div[style*="linear-gradient(135deg,#1A3A52"] {
        padding: 0.75rem !important;
    }
    .build-plan-section div[style*="1.5rem"] {
        font-size: 1.2rem !important;
    }
    /* Card stat boxes */
    div[style*="grid-template-columns:1fr 1fr;gap:8px"] {
        gap: 6px !important;
    }
    /* Details/summary button */
    details summary > div {
        padding: 0.55rem 0.75rem !important;
    }
    /* Feedback widget */
    .feedback-widget {
        padding: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .niche-card-body {
        padding: 0.85rem !important;
    }
    /* Platform tabs */
    .platform-btns {
        gap: 0.35rem !important;
    }
    .platform-btn {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.65rem !important;
    }
    /* Example chips */
    .example-chips {
        gap: 0.35rem !important;
    }
}
