/* =============================================
   Plugin: Phong Thủy Số Điện Thoại
   File: phong-cach.css
   ============================================= */

/* --- Reset & Container --- */
.ptdt-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ptdt-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 0;
}

/* --- Form --- */
.ptdt-form {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.ptdt-form-group {
    margin-bottom: 16px;
}

.ptdt-form-group:last-child {
    margin-bottom: 0;
}

.ptdt-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.ptdt-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a1a;
    transition: border-color 0.2s;
    outline: none;
}

.ptdt-input:focus {
    border-color: #666;
    background: #fff;
}

.ptdt-dob-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ptdt-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 400px) {
    .ptdt-form-row-2 {
        grid-template-columns: 1fr;
    }
}

.ptdt-select {
    width: 100%;
    padding: 10px 10px;
    font-size: 15px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a1a;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.ptdt-select:focus {
    border-color: #666;
    background: #fff;
}

.ptdt-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s, transform 0.1s;
}

.ptdt-btn:hover {
    background: #333;
}

.ptdt-btn:active {
    transform: scale(0.99);
}

/* --- Kết quả --- */
.ptdt-result {
    display: none;
}

.ptdt-result.active {
    display: block;
}

/* --- Grid tổng quan --- */
.ptdt-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

@media (min-width: 480px) {
    .ptdt-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ptdt-metric {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
}

.ptdt-metric-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ptdt-metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
}

/* --- Card --- */
.ptdt-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ptdt-card-body {
    padding: 16px 20px;
}

.ptdt-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 9px 20px;
    margin-bottom: 0;
}

/* Gradient theo kết quả */
.ptdt-hdr-good,
.ptdt-hdr-ok,
.ptdt-hdr-bad,
.ptdt-hdr-neutral { background: #f0f0f0; color: #555; }

/* --- Badge --- */
.ptdt-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.ptdt-badge-good {
    background: #e6f4d7;
    color: #2d6a0f;
}

.ptdt-badge-ok {
    background: #fef3c7;
    color: #92400e;
}

.ptdt-badge-bad {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Thanh điểm --- */
.ptdt-bar-wrap {
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.ptdt-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.ptdt-bar-good  { background: #4ade80; }
.ptdt-bar-ok    { background: #fbbf24; }
.ptdt-bar-bad   { background: #f87171; }

/* --- Chip chữ số --- */
.ptdt-digit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.ptdt-digit-chip {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

/* Màu theo ngũ hành */
.ptdt-hanh-Thuy  { background: #dbeafe; color: #1e40af; }
.ptdt-hanh-Moc   { background: #dcfce7; color: #15803d; }
.ptdt-hanh-Tho   { background: #fef9c3; color: #854d0e; }
.ptdt-hanh-Kim   { background: #f1f5f9; color: #475569; }
.ptdt-hanh-Hoa   { background: #fee2e2; color: #991b1b; }

/* --- Chip hành --- */
.ptdt-hanh-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}

.ptdt-hanh-chip {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* --- Thanh Âm Dương --- */
.ptdt-adrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.ptdt-adrow-label {
    font-size: 12px;
    color: #888;
    min-width: 56px;
}

.ptdt-adrow-bar {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #dbeafe;
    overflow: hidden;
}

.ptdt-adrow-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.5s;
}

/* --- Ghi chú tốt/xấu --- */
.ptdt-note {
    font-size: 13px;
    padding: 3px 0;
    line-height: 1.6;
}

.ptdt-note-good { color: #15803d; }
.ptdt-note-bad  { color: #dc2626; }
.ptdt-note-neutral { color: #666; }

/* --- Quẻ chip --- */
.ptdt-que-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.ptdt-que-chip {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.ptdt-que-cat  { background: #dcfce7; color: #15803d; }
.ptdt-que-hung { background: #fee2e2; color: #991b1b; }

/* --- Mệnh lớn --- */
.ptdt-menh-ten {
    font-size: 18px;
    font-weight: 600;
    margin: 4px 0 2px;
    color: #1a1a1a;
}

.ptdt-menh-mo {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.ptdt-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.ptdt-tag {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.ptdt-tag-need { background: #dcfce7; color: #15803d; }
.ptdt-tag-avoid { background: #fee2e2; color: #991b1b; }

/* --- Dãy sao --- */
.ptdt-sao-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 10px;
}

.ptdt-sao {
    font-size: 20px;
    color: #ddd;
    line-height: 1;
}

.ptdt-sao-on {
    color: #f5a623;
}

.ptdt-sao-diem {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    margin-left: 6px;
}

/* --- Nút chi tiết --- */
.ptdt-btn-detail {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    background: transparent;
    color: #1a1a1a;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}

.ptdt-btn-detail:hover {
    background: #f5f5f5;
}

/* --- Lỗi --- */
.ptdt-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.ptdt-error.show {
    display: block;
}

/* --- Loading --- */
.ptdt-loading {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
    display: none;
}

.ptdt-loading.show {
    display: block;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .ptdt-form {
        padding: 16px;
    }

    .ptdt-card {
        padding: 14px 16px;
    }

    .ptdt-metric-value {
        font-size: 16px;
    }
}