/* ═══════════════════════════════════════════════════════════
   palm_reading.css — Xem Chỉ Tay AI Styles
   Upload zone, Canvas preview, Palm line result cards
   ═══════════════════════════════════════════════════════════ */

/* ── Upload Zone ── */

.pr-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;
}

.pr-upload-zone:hover,
.pr-upload-zone.drag-over {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
    transform: scale(1.01);
}

.pr-upload-icon { font-size: 3rem; opacity: 0.7; }
.pr-upload-text { font-size: 0.95rem; color: var(--text-secondary, #a0a0b8); font-weight: 500; }
.pr-upload-hint { font-size: 0.78rem; color: var(--text-tertiary, #666); }

/* ── Gender Selection ── */

.pr-gender-selector {
    display: flex; gap: 12px; justify-content: center; margin-bottom: 20px;
}

.pr-gender-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 12px;
    border: 2px solid var(--border, #3a3a4e);
    background: var(--bg-card, #1e1e2e);
    color: var(--text-primary, #e0e0f0);
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    transition: all 0.3s; font-family: inherit;
}

.pr-gender-btn:hover { border-color: #f59e0b; }
.pr-gender-btn.active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(234,88,12,.15));
    box-shadow: 0 0 20px rgba(245,158,11,.15);
}

/* ── Preview Area ── */

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

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

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

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

/* ── Action Buttons ── */

.pr-actions {
    display: flex; gap: 10px; justify-content: center;
    padding: 16px; flex-wrap: wrap;
}

.pr-analyze-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all 0.3s; font-family: inherit;
}

.pr-analyze-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,158,11,.3); }
.pr-analyze-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pr-reset-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 12px 24px; border-radius: 12px;
    border: 1px solid var(--border, #3a3a4e);
    background: transparent; color: var(--text-secondary, #a0a0b8);
    font-size: 0.9rem; cursor: pointer; transition: all 0.2s; font-family: inherit;
}

.pr-reset-btn:hover { border-color: #f59e0b; color: #f59e0b; }

.pr-status {
    text-align: center; font-size: 0.85rem;
    color: var(--text-tertiary, #666); padding: 8px;
}

/* ── Result Area ── */

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

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

/* Overall Score */

.pr-overall {
    display: flex; flex-direction: column; align-items: center;
    padding: 24px; margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(234,88,12,.08));
    border-radius: 16px; border: 1px solid rgba(245,158,11,.2);
}

.pr-score-circle {
    width: 120px; height: 120px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 4px solid var(--score-color, #f59e0b);
    box-shadow: 0 0 30px color-mix(in srgb, var(--score-color, #f59e0b) 30%, transparent);
    margin-bottom: 16px;
}

.pr-score-number { font-size: 2.2rem; font-weight: 800; color: var(--score-color, #f59e0b); line-height: 1; }
.pr-score-label { font-size: 0.72rem; color: var(--text-tertiary, #666); text-transform: uppercase; letter-spacing: 1px; }

.pr-overall-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; width: 100%; margin-top: 16px;
}

.pr-meta-item {
    text-align: center; padding: 12px; border-radius: 10px;
    background: var(--bg-card, #1e1e2e); border: 1px solid var(--border-light, #2a2a3e);
}

.pr-meta-label { font-size: 0.72rem; color: var(--text-tertiary, #666); text-transform: uppercase; }
.pr-meta-value { font-size: 1rem; font-weight: 700; margin-top: 4px; }

/* Palm Line Cards */

.pr-lines-grid { display: grid; gap: 16px; margin-bottom: 24px; }

.pr-line-card {
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border-light, #2a2a3e);
    border-radius: 14px; padding: 20px; transition: all 0.3s;
}

.pr-line-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 20px rgba(245,158,11,.1);
}

.pr-line-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}

.pr-line-name { font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pr-line-score {
    font-size: 0.85rem; font-weight: 700; padding: 4px 12px;
    border-radius: 20px; background: rgba(245,158,11,.1); color: #f59e0b;
}

.pr-line-verdict {
    font-size: 0.88rem; color: var(--text-secondary, #a0a0b8);
    line-height: 1.6; margin-bottom: 10px;
}

.pr-line-clarity {
    font-size: 0.75rem; color: var(--text-tertiary, #666);
    display: flex; gap: 12px; flex-wrap: wrap;
}

.pr-line-tag {
    padding: 3px 10px; border-radius: 6px;
    background: rgba(245,158,11,.08); font-weight: 500;
}

/* Palm Shape */

.pr-palm-shape {
    padding: 20px; border-radius: 14px; margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(139,92,246,.08));
    border: 1px solid rgba(59,130,246,.2);
}

.pr-palm-shape h3 { margin-bottom: 8px; font-size: 1rem; }

/* Viral Share */

.pr-share-box {
    text-align: center; padding: 24px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(234,88,12,.05));
    border: 1px solid rgba(245,158,11,.15);
}

.pr-share-box .pr-share-quote {
    font-size: 1rem; font-weight: 600; margin-bottom: 16px;
    line-height: 1.5;
}

.pr-share-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.pr-share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 10px; border: 1px solid var(--border, #3a3a4e);
    background: var(--bg-card, #1e1e2e); color: var(--text-primary, #e0e0f0);
    font-size: 0.85rem; font-weight: 500; cursor: pointer; text-decoration: none;
    transition: all 0.2s; font-family: inherit;
}

.pr-share-btn:hover { border-color: #f59e0b; transform: translateY(-1px); }
.pr-share-btn.primary { background: linear-gradient(135deg, #f59e0b, #ea580c); border: none; color: #fff; }

/* Feedback */

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

.pr-feedback p { margin-bottom: 12px; font-size: 0.9rem; }

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

.pr-feedback-btn {
    padding: 8px 18px; border-radius: 8px; border: 1px solid var(--border, #3a3a4e);
    background: transparent; color: var(--text-secondary, #a0a0b8);
    font-size: 0.85rem; cursor: pointer; transition: all 0.2s; font-family: inherit;
}

.pr-feedback-btn:hover { border-color: #f59e0b; color: #f59e0b; }
.pr-feedback-btn.selected { background: #f59e0b; color: #fff; border-color: #f59e0b; }

/* Overlay image */

.pr-overlay-image {
    width: 100%; border-radius: 12px; margin: 16px 0;
    border: 1px solid var(--border-light, #2a2a3e);
}

/* Legend */

.pr-legend {
    display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
    margin: 16px 0; padding: 12px; border-radius: 10px;
    background: var(--bg-card, #1e1e2e);
}

.pr-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-secondary, #a0a0b8); }
.pr-legend-color { width: 16px; height: 3px; border-radius: 2px; }

/* ── Responsive ── */

@media (max-width: 600px) {
    .pr-gender-selector { flex-direction: column; align-items: center; }
    .pr-gender-btn { width: 100%; max-width: 200px; justify-content: center; }
    .pr-score-circle { width: 100px; height: 100px; }
    .pr-score-number { font-size: 1.8rem; }
    .pr-overall-meta { grid-template-columns: 1fr 1fr; }
}
