/* ═══════════════════════════════════════════════════════════
   face_reading.css — Nhân Tướng Học AI Styles
   Upload zone, Canvas preview, 12 Palace result cards
   ═══════════════════════════════════════════════════════════ */

/* ── Upload Zone ── */

.fr-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border: 2px dashed var(--border, #3a3a4e);
    border-radius: 16px;
    background: var(--bg-input, #16161e);
    cursor: pointer;
    transition: all 0.3s;
    padding: 32px;
    text-align: center;
    gap: 12px;
}

.fr-upload-zone:hover,
.fr-upload-zone.drag-over {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
    transform: scale(1.01);
}

.fr-upload-icon {
    font-size: 3rem;
    opacity: 0.7;
}

.fr-upload-text {
    font-size: 0.95rem;
    color: var(--text-secondary, #a0a0b8);
    font-weight: 500;
}

.fr-upload-hint {
    font-size: 0.78rem;
    color: var(--text-tertiary, #666);
}

/* ── Preview Area ── */

.fr-preview-area {
    display: none;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.fr-canvas-container {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fr-source-img {
    display: none;
}

#fr-mesh-canvas {
    display: none;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
}

/* ── Action Buttons ── */

.fr-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.fr-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.fr-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.fr-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.fr-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fr-btn-secondary {
    background: var(--bg-input, #16161e);
    color: var(--text-secondary, #a0a0b8);
    border: 1px solid var(--border, #3a3a4e);
}

.fr-btn-secondary:hover {
    border-color: #8b5cf6;
    color: var(--text-primary, #e0e0f0);
}

/* ── Status Text ── */

.fr-status {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b8);
    margin-top: 12px;
    min-height: 24px;
}

/* ── Result Area ── */

.fr-result-area {
    display: none;
    margin-top: 24px;
    animation: frFadeIn 0.5s ease;
}

@keyframes frFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Overall Score ── */

.fr-overall {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: var(--bg-card, #1e1e2e);
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light, #2a2a3e);
}

.fr-score-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--score-color, #4ECDC4) 0%, var(--score-color, #4ECDC4) calc(var(--score-color) * 1%), rgba(255,255,255,0.1) 0%);
    border: 3px solid var(--score-color, #4ECDC4);
    flex-shrink: 0;
    box-shadow: 0 0 20px color-mix(in srgb, var(--score-color, #4ECDC4) 30%, transparent);
}

.fr-score-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary, #e0e0f0);
    line-height: 1;
}

.fr-score-label {
    font-size: 0.65rem;
    color: var(--text-tertiary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fr-face-shape {
    flex: 1;
}

.fr-shape-emoji {
    font-size: 1.5rem;
}

.fr-face-shape h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 4px 0 6px;
    color: var(--text-primary, #e0e0f0);
}

.fr-face-shape p {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b8);
    line-height: 1.6;
}

/* ── Tam Đình Bar ── */

.fr-section {
    margin-bottom: 20px;
}

.fr-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fr-tam-dinh {
    background: var(--bg-card, #1e1e2e);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-light, #2a2a3e);
}

.fr-td-bar {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    height: 36px;
    margin-bottom: 12px;
}

.fr-td-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: flex 0.3s ease;
}

.fr-td-seg span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.fr-td-verdict {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b8);
    line-height: 1.6;
}

/* ── 12 Palace Cards ── */

.fr-palaces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.fr-palace-card {
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border-light, #2a2a3e);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.fr-palace-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fr-palace-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fr-palace-icon {
    font-size: 1.3rem;
}

.fr-palace-title {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fr-palace-title strong {
    font-size: 0.9rem;
    color: var(--text-primary, #e0e0f0);
}

.fr-palace-han {
    font-size: 0.72rem;
    color: var(--text-tertiary, #666);
}

.fr-palace-score {
    font-size: 1.3rem;
    font-weight: 800;
}

.fr-palace-bar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}

.fr-palace-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.fr-palace-meaning {
    font-size: 0.75rem;
    color: var(--text-tertiary, #666);
    margin-bottom: 4px;
}

.fr-palace-verdict {
    font-size: 0.82rem;
    color: var(--text-secondary, #a0a0b8);
    line-height: 1.6;
}

/* ── Disclaimer ── */

.fr-disclaimer {
    padding: 16px;
    background: rgba(139, 92, 246, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.fr-disclaimer p {
    font-size: 0.8rem;
    color: var(--text-tertiary, #666);
    line-height: 1.6;
    margin: 0;
}

/* ── Share Bar ── */

.fr-share-bar .fr-btn {
    display: inline-flex;
}

.fr-share-bar {
    padding: 16px 0;
}

/* ── Mobile Responsive ── */

@media (max-width: 600px) {
    .fr-overall {
        flex-direction: column;
        text-align: center;
    }

    .fr-palaces-grid {
        grid-template-columns: 1fr;
    }

    .fr-td-seg {
        font-size: 0.65rem;
    }

    .fr-actions {
        flex-direction: column;
    }

    .fr-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Trust Badge ── */

.fr-trust-badge {
    text-align: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(59,130,246,0.1));
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary, #a0a0c0);
    margin-bottom: 20px;
}

/* ── Celebrity Match Card ── */

.fr-celebrity-card {
    text-align: center;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(236,72,153,0.08));
    border: 2px solid transparent;
    border-radius: 16px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    animation: fr-celeb-glow 3s ease-in-out infinite;
}

@keyframes fr-celeb-glow {
    0%, 100% { border-color: rgba(139,92,246,0.4); box-shadow: 0 0 20px rgba(139,92,246,0.1); }
    50% { border-color: rgba(236,72,153,0.4); box-shadow: 0 0 30px rgba(236,72,153,0.15); }
}

.fr-celeb-label {
    font-size: 0.82rem;
    color: var(--text-tertiary, #888);
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.fr-celeb-name {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.fr-celeb-desc {
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0c0);
}

/* ── Personality Badge ── */

.fr-personality-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border-light, #2a2a3e);
    border-radius: 14px;
    margin-bottom: 20px;
}

.fr-personality-score {
    font-size: 2.4rem;
    font-weight: 900;
    color: #FFD93D;
    line-height: 1;
}

.fr-personality-score span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-tertiary, #888);
}

.fr-personality-info {
    text-align: left;
}

.fr-personality-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #e0e0f0);
}

.fr-personality-type {
    font-size: 0.82rem;
    color: var(--text-tertiary, #888);
    margin-top: 2px;
}

/* ── Viral Share Quote ── */

.fr-viral-quote {
    text-align: center;
    padding: 16px 20px;
    background: var(--bg-card, #1e1e2e);
    border-left: 3px solid #8b5cf6;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
}

.fr-viral-quote p {
    font-style: italic;
    font-size: 0.92rem;
    color: var(--text-secondary, #a0a0c0);
    margin: 0 0 12px;
}

/* ── Feedback Loop ── */

.fr-feedback {
    text-align: center;
    padding: 20px;
    background: var(--bg-card, #1e1e2e);
    border-radius: 14px;
    border: 1px solid var(--border-light, #2a2a3e);
    margin: 20px 0;
}

.fr-feedback-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0f0);
    margin: 0 0 12px;
}

.fr-feedback-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.fr-feedback-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border, #3a3a4e);
    background: var(--bg-secondary, #161622);
    color: var(--text-primary, #e0e0f0);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.fr-feedback-btn:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139,92,246,0.2);
}
