/* ─── MTJ Impact Data Frontend Styles ────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.mtj-impact-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    color: #1a1a2e;
}
/* tabs button hover _______________________________________________________ */
/* 1. Base Style (Inactive Buttons) */
.mtj-tab-btn {
    color: #AB541B !important;
    border: 1px solid #AB541B !important;
    background-color: transparent !important; /* Ensures inactive background is clear/white */
}

/* 2. Active State AND Hover State */
.mtj-tab-btn.active,
.mtj-tab-btn:hover {
    background-color: #AB541B !important;
    color: #ffffff !important; /* White text */
    border-color: #AB541B !important;
    cursor: pointer !important;
}
/* ─── Header ─────────────────────────────────────────────────────────────── */

.mtj-impact-header {
    text-align: center;
    margin-bottom: 40px;
}

.mtj-impact-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #C6621F, #a8521a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
}

.mtj-impact-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}

/* ─── No Data ────────────────────────────────────────────────────────────── */

.mtj-no-data {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 16px;
    color: #9ca3af;
    font-size: 16px;
}

/* ─── Year Cards ─────────────────────────────────────────────────────────── */

.mtj-years-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mtj-year-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.mtj-year-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.06);
}

.mtj-year-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #C6621F, #a8521a);
    color: #fff;
    transition: opacity 0.2s ease;
}

.mtj-year-header:hover {
    opacity: 0.92;
}

.mtj-year-label {
    font-size: 24px;
    font-weight: 700;
    flex: 1;
}

.mtj-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.mtj-chevron {
    font-size: 12px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.mtj-year-header.active .mtj-chevron,
.mtj-month-header.active .mtj-chevron {
    transform: rotate(180deg);
}

/* ─── Year Body ──────────────────────────────────────────────────────────── */

.mtj-year-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fdf3eb;
    animation: mtjSlideDown 0.3s ease;
}

@keyframes mtjSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Tab Bar ────────────────────────────────────────────────────────────── */

.mtj-tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mtj-tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #C6621F;
    border-radius: 10px;
    background: #fff;
    color: #C6621F;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.mtj-tab-btn:hover {
    background: rgba(198, 98, 31, 0.08);
}

.mtj-tab-btn.active {
    background: linear-gradient(135deg, #C6621F, #a8521a);
    color: #fff;
    border-color: #C6621F;
    box-shadow: 0 4px 12px rgba(198, 98, 31, 0.3);
}

/* ─── Tab Panels ─────────────────────────────────────────────────────────── */

.mtj-tab-panel {
    animation: mtjSlideDown 0.3s ease;
}

.mtj-annual-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

/* ─── Month Cards ────────────────────────────────────────────────────────── */

.mtj-month-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 6px !important;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s;
}

.mtj-month-card:hover {
    border-color: #C6621F;
}

.mtj-month-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 16px;
    color: #1a1a2e;
    transition: background 0.2s;
}

.mtj-month-header:hover {
    background: #fdf3eb;
}

.mtj-month-label {
    flex: 1;
}

/* ─── Month Body (Details) ───────────────────────────────────────────────── */

.mtj-month-body {
    padding: 0 20px 20px;
    animation: mtjSlideDown 0.3s ease;
}

.mtj-details-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Detail Sections ────────────────────────────────────────────────────── */

.mtj-detail-section {
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s;
}

.mtj-detail-section:hover {
    transform: translateY(-1px);
}

.mtj-section-medical {
    background: linear-gradient(135deg, #fdf3eb, #fce8d5);
    border-left: 4px solid #C6621F;
}

.mtj-section-medicines {
    background: linear-gradient(135deg, #fef9f4, #fce8d5);
    border-left: 4px solid #d4873e;
}

.mtj-section-food {
    background: linear-gradient(135deg, #fff8f0, #fce8d5);
    border-left: 4px solid #e89b5e;
}

.mtj-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.mtj-section-title h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #C6621F;
    letter-spacing: 0.5px;
}

/* ─── Stats ──────────────────────────────────────────────────────────────── */

.mtj-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mtj-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.mtj-stat-label {
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
}

.mtj-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ─── Documents Section ──────────────────────────────────────────────────── */

.mtj-pdf-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.mtj-pdf-heading {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: #C6621F;
}

.mtj-pdf-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Base button style with high specificity to override theme defaults */
.mtj-impact-wrapper .mtj-pdf-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 2px solid #C6621F !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    background-color: #fff !important;
    background-image: none !important;
    color: #C6621F !important;
    line-height: 1.3;
    outline: none !important;
    box-shadow: none;
}

.mtj-impact-wrapper .mtj-pdf-view-btn:hover,
.mtj-impact-wrapper .mtj-pdf-view-btn:focus,
.mtj-impact-wrapper .mtj-pdf-view-btn:active {
    background-color: #C6621F !important;
    background-image: none !important;
    border-color: #C6621F !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 98, 31, 0.3) !important;
}

/* Different button accent for types - enforcing theme color identity */
.mtj-impact-wrapper .mtj-pdf-patient {
    border-color: #C6621F !important;
    color: #C6621F !important;
}

.mtj-impact-wrapper .mtj-pdf-patient:hover {
    background-color: #C6621F !important;
    color: #fff !important;
}

.mtj-impact-wrapper .mtj-pdf-summary {
    border-color: #C6621F !important;
    color: #C6621F !important;
}

.mtj-impact-wrapper .mtj-pdf-summary:hover {
    background-color: #C6621F !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(198, 98, 31, 0.3) !important;
}

.mtj-impact-wrapper .mtj-pdf-food {
    border-color: #C6621F !important;
    color: #C6621F !important;
}

.mtj-impact-wrapper .mtj-pdf-food:hover {
    background-color: #C6621F !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(198, 98, 31, 0.3) !important;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */

.mtj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mtjFadeIn 0.2s ease;
}

@keyframes mtjFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mtj-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: mtjModalSlide 0.3s ease;
}

@keyframes mtjModalSlide {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mtj-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 2px solid #C6621F;
    background: #fdf3eb;
}

.mtj-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #C6621F;
}

.mtj-modal-close {
    background: transparent !important;
    border: none !important;
    font-size: 28px;
    cursor: pointer;
    color: #C6621F !important;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: none !important;
}

.mtj-modal-close:hover {
    color: #fff !important;
    background-color: #C6621F !important;
    box-shadow: 0 4px 12px rgba(198, 98, 31, 0.3) !important;
}

.mtj-modal-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.mtj-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.mtj-modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ─── Document Protection ────────────────────────────────────────────────── */

/* Disable text selection inside modal */
.mtj-modal-body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    transition: filter 0.3s ease;
    position: relative;
}

/* Watermark overlay — appears on top of all documents */
.mtj-modal-body::after {
    content: 'MTJ Foundation — Confidential';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 42px;
    font-weight: 800;
    color: rgba(198, 98, 31, 0.08);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Hide everything when printing (Ctrl+P) */
@media print {

    .mtj-modal-overlay,
    .mtj-modal,
    .mtj-modal-body,
    .mtj-modal-body iframe,
    .mtj-modal-body img {
        display: none !important;
        visibility: hidden !important;
    }

    body::after {
        content: 'This document is protected and cannot be printed.';
        display: block;
        text-align: center;
        font-size: 24px;
        padding: 60px;
        color: #C6621F;
    }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .mtj-impact-wrapper {
        padding: 12px;
    }

    .mtj-impact-title {
        font-size: 24px;
    }

    .mtj-year-header {
        padding: 16px 18px;
    }

    .mtj-year-label {
        font-size: 20px;
    }

    .mtj-stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .mtj-stat-value {
        font-size: 18px;
    }

    .mtj-modal {
        width: 95%;
        height: 80vh;
        border-radius: 12px;
    }

    .mtj-pdf-buttons {
        flex-direction: column;
    }

    .mtj-pdf-view-btn {
        width: 100%;
    }

    .mtj-tab-bar {
        flex-direction: column;
    }

    .mtj-tab-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
}