/**
 * Kỳ Môn Trọn Đời — Premium Styling
 * Màu sắc: Tông tối (Đen/Xám đậm) kết hợp Vàng kim và Đỏ thẫm cổ điển
 * Thiết kế khoa học, responsive, tối ưu UX
 */

.kmtd-wrapper {
    background-color: #0d0f12;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #1f242d;
    max-width: 1200px;
    margin: 0 auto 30px auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* HEADER */
.kmtd-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #2d3440;
}
.kmtd-title {
    color: #d4af37;
    font-family: "Noto Serif", Georgia, serif;
    font-size: 2rem;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.kmtd-tagline {
    color: #a0aec0;
    font-size: 1rem;
    margin: 0;
    font-style: italic;
}

/* FORM SECTION */
.kmtd-form-section {
    background-color: #13171e;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #202733;
    margin-bottom: 30px;
}
.kmtd-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px -10px;
}
.kmtd-form-row:last-child {
    margin-bottom: 0;
}
.kmtd-form-group {
    padding: 0 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.kmtd-half { width: 50%; }
.kmtd-third { width: 33.33%; }
.kmtd-quarter { width: 25%; }

.kmtd-form-group label {
    color: #cbd5e0;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}
.kmtd-input {
    background-color: #1a202c;
    border: 1px solid #2d3748;
    color: #f7fafc;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    height: 42px;
}
.kmtd-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212,175,55,0.25);
}

.kmtd-btn-group {
    justify-content: flex-end;
}
.kmtd-btn-lap {
    background: linear-gradient(135deg, #d4af37 0%, #aa8410 100%);
    border: none;
    color: #0d0f12;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(212,175,55,0.2);
}
.kmtd-btn-lap:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212,175,55,0.35);
    background: linear-gradient(135deg, #f5c443 0%, #b89115 100%);
}

/* PROFILE CARD */
.kmtd-profile-card {
    background: linear-gradient(135deg, #1b202a 0%, #11141b 100%);
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.kmtd-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2d3545;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.kmtd-user-info h2 {
    color: #f7fafc;
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-family: "Noto Serif", Georgia, serif;
}
.kmtd-user-meta {
    margin: 0 0 5px 0;
    color: #a0aec0;
    font-size: 0.95rem;
}
.kmtd-user-meta strong, .kmtd-user-can-chi strong {
    color: #d4af37;
}
.kmtd-user-can-chi {
    margin: 0;
    color: #a0aec0;
    font-size: 0.9rem;
}
.kmtd-destiny-badge {
    background-color: rgba(212,175,55,0.1);
    border: 1px solid #d4af37;
    padding: 10px 18px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
}
.kmtd-badge-label {
    font-size: 0.75rem;
    color: #a0aec0;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.kmtd-badge-val {
    font-size: 1.25rem;
    color: #d4af37;
    font-weight: 700;
    font-family: "Noto Serif", Georgia, serif;
}

.kmtd-core-elements {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.kmtd-element-item {
    width: 23%;
    background-color: #121620;
    border: 1px solid #232a39;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}
.kmtd-element-item:hover {
    border-color: #d4af37;
    background-color: #171d29;
}
.kmtd-el-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}
.kmtd-el-label {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-bottom: 2px;
}
.kmtd-el-val {
    font-size: 1.05rem;
    color: #f7fafc;
    font-weight: 600;
}

/* BODY LAYOUT */
.kmtd-body-layout {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}
.kmtd-chart-column {
    width: 42%;
    padding: 0 15px;
    box-sizing: border-box;
}
.kmtd-report-column {
    width: 58%;
    padding: 0 15px;
    box-sizing: border-box;
}
.kmtd-column-title {
    color: #cbd5e0;
    font-size: 1.1rem;
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
    border-left: 3px solid #d4af37;
    padding-left: 10px;
}

/* 3x3 CỬU CUNG GRID */
.kmtd-cuu-cung {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 8px;
    background-color: #12151b;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #222834;
    aspect-ratio: 1 / 1;
}

.kmtd-c-cell {
    background-color: #191e27;
    border: 1px solid #2e3646;
    border-radius: 6px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
    transition: all 0.3s ease;
}
.kmtd-c-cell:hover:not(.kmtd-c-center) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-color: #a0aec0;
}

/* MỆNH CUNG HIGHLIGHT */
.kmtd-c-cell.active {
    background: linear-gradient(135deg, #2c1a08 0%, #1a1005 100%);
    border: 1.5px solid #d4af37;
    box-shadow: 0 0 15px rgba(212,175,55,0.25);
}
.kmtd-menh-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #b91c1c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 4px;
    text-transform: uppercase;
}

.kmtd-c-center {
    background-color: #11141b;
    border-color: #212633;
    justify-content: center;
    text-align: center;
}
.kmtd-center-can {
    font-size: 1.6rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 2px;
}
.kmtd-center-lbl {
    font-size: 0.75rem;
    color: #718096;
    letter-spacing: 0.5px;
}

.kmtd-c-deity {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f6ad55;
    text-align: center;
}
.kmtd-c-middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
    margin: 4px 0;
}
.kmtd-c-gate {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e53e3e;
    font-family: "Noto Serif", Georgia, serif;
}
.kmtd-c-tcan {
    font-size: 1.15rem;
    font-weight: 700;
    color: #cbd5e0;
}
.kmtd-c-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
    margin-bottom: 4px;
}
.kmtd-c-star {
    font-size: 0.8rem;
    color: #3182ce;
}
.kmtd-c-dcan {
    font-size: 0.85rem;
    color: #a0aec0;
}
.kmtd-c-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #718096;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 4px;
}

/* REPORT CỘT PHẢI */
.kmtd-report-tabs {
    display: flex;
    border-bottom: 2px solid #232a39;
    margin-bottom: 20px;
}
.kmtd-r-tab {
    background: none;
    border: none;
    color: #718096;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.kmtd-r-tab:hover {
    color: #cbd5e0;
}
.kmtd-r-tab.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
}

.kmtd-report-contents {
    position: relative;
}
.kmtd-r-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.kmtd-r-content.active {
    display: block;
}

.kmtd-reading-box {
    background-color: #13171e;
    border-radius: 8px;
    border: 1px solid #1f2530;
    padding: 20px;
    margin-bottom: 15px;
    line-height: 1.6;
}
.kmtd-reading-box h4 {
    margin: 0 0 10px 0;
    color: #f7fafc;
    font-size: 1.05rem;
    border-bottom: 1px solid #1f2530;
    padding-bottom: 8px;
}
.kmtd-reading-box p {
    margin: 0;
    color: #cbd5e0;
    font-size: 0.95rem;
}
.kmtd-reading-box.highlight {
    border-color: rgba(212,175,55,0.3);
    background-color: rgba(212,175,55,0.02);
}
.kmtd-reading-box.highlight h4 {
    color: #d4af37;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* PAYWALL BOX */
.kmtd-paywall-box {
    background: linear-gradient(135deg, #181c25 0%, #10131a 100%);
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin-top: 15px;
}
.kmtd-paywall-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}
.kmtd-paywall-box h4 {
    color: #f7fafc;
    font-size: 1.2rem;
    margin: 0 0 10px 0;
    font-family: "Noto Serif", Georgia, serif;
}
.kmtd-paywall-box p {
    color: #a0aec0;
    font-size: 0.95rem;
    margin: 0 0 20px 0;
    line-height: 1.5;
}
.kmtd-paywall-btn {
    display: inline-block;
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none !important;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
    transition: all 0.3s ease;
}
.kmtd-paywall-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(185, 28, 28, 0.5);
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
}
.kmtd-paywall-note {
    font-size: 0.8rem;
    color: #718096 !important;
    margin: 15px 0 0 0 !important;
    font-style: italic;
}

/* RESPONSIVE */
@media (max-width: 991px) {
    .kmtd-chart-column, .kmtd-report-column {
        width: 100%;
    }
    .kmtd-chart-column {
        margin-bottom: 30px;
    }
}
@media (max-width: 768px) {
    .kmtd-half, .kmtd-third, .kmtd-quarter {
        width: 50%;
    }
    .kmtd-element-item {
        width: 48%;
        margin-bottom: 12px;
    }
}
@media (max-width: 480px) {
    .kmtd-half, .kmtd-third, .kmtd-quarter {
        width: 100%;
    }
    .kmtd-element-item {
        width: 100%;
    }
}


/* Marriage Tab Sub-Readings styling */
.kmtd-sub-reading {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.kmtd-sub-reading:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.kmtd-sub-reading h5 {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin-top: 0;
    margin-bottom: 12px;
    border-left: 3.5px solid var(--accent-gold);
    padding-left: 10px;
}
.kmtd-sub-reading ul {
    margin: 8px 0;
    padding-left: 20px;
}
.kmtd-sub-reading li {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 6px;
}
.kmtd-sub-reading p {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.6;
}
