/* ==========================================================================
   5-YEAR FINANCIAL HIGHLIGHTS & KEY HIGHLIGHTS STYLING
   ENEST Group Berhad - Investor Relations
   Matches Bursa Malaysia Corporate Annual Report Design Standards
   ========================================================================== */

/* Theme / Layout Compatibility Overrides */
body.page-id-2056 #main,
body:has(#enest-financial-highlights) #main {
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body.page-id-2056 #content,
body:has(#enest-financial-highlights) #content {
    margin-bottom: 0 !important;
}

:root {
    --fh-green-dark: #004d2e;
    --fh-green: #00824b;
    --fh-green-light: #00a862;
    --fh-green-subtle: #ebf6f0;
    --fh-green-border: #80c4a4;
    --fh-sage-bar: #c4dab9;
    --fh-sage-text: #1b4d24;
    --fh-peach-col: #fff1e6;
    --fh-peach-border: #f8cbb1;
    --fh-coral: #ea5444;
    --fh-text-dark: #1e293b;
    --fh-text-muted: #64748b;
    --fh-bg-gray: #f8fafc;
    --fh-border-light: #e2e8f0;
    --fh-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --fh-shadow-md: 0 8px 24px rgba(0, 77, 46, 0.08);
    --fh-shadow-lg: 0 16px 36px rgba(0, 77, 46, 0.12);
    --fh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.fh-portal-wrapper {
    font-family: var(--fh-font);
    color: var(--fh-text-dark);
    line-height: 1.5;
    background: #ffffff;
    padding-top: 140px;
    padding-bottom: 60px;
    width: 100%;
    box-sizing: border-box;
}

.fh-portal-wrapper *,
.fh-portal-wrapper *::before,
.fh-portal-wrapper *::after {
    box-sizing: border-box;
}

.fh-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}


/* ==========================================================================
   Header Banner / Title Area
   ========================================================================== */
.fh-page-hero {
    text-align: center !important;
    padding: 10px 0 40px 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.fh-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--fh-green-subtle);
    color: var(--fh-green);
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
    border: 1px solid rgba(0, 130, 75, 0.15);
}

.fh-hero-title {
    font-size: 36px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px 0 !important;
    line-height: 1.25;
    text-align: center !important;
    width: 100%;
}

.fh-hero-subtitle {
    font-size: 16px;
    color: var(--fh-text-muted);
    max-width: 720px;
    margin: 0 auto !important;
    text-align: center !important;
    display: block !important;
    line-height: 1.6;
    width: 100%;
}

/* ==========================================================================
   SECTION 1: KEY HIGHLIGHTS CIRCULAR BADGES (Matches Reference Image 2)
   ========================================================================== */
.fh-highlights-section {
    margin-bottom: 65px;
    padding: 20px 0;
}

.fh-pill-header-container {
    text-align: center;
    margin-bottom: 45px;
}

.fh-pill-header {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
    border: 2px solid var(--fh-green);
    border-radius: 9999px;
    padding: 8px 24px 8px 30px;
    box-shadow: 0 6px 20px rgba(0, 130, 75, 0.08);
}

.fh-pill-header-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--fh-green);
    letter-spacing: -0.2px;
}

.fh-pill-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 24px;
    border-radius: 9999px;
    border: 2px solid var(--fh-green);
    background: #e8f5ee;
    position: relative;
}

.fh-pill-header-icon::after {
    content: "";
    position: absolute;
    right: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--fh-green);
}

/* 3x3 Circular Grid */
.fh-badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 45px 30px;
    justify-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.fh-badge-card {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fh-badge-card:hover {
    transform: translateY(-6px) scale(1.03);
}

/* Concentric Red and Green Orbit Arc Lines */
.fh-badge-orbits {
    position: absolute;
    inset: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    pointer-events: none;
    z-index: 1;
}

.fh-badge-orbits svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Center Solid Green Circle */
.fh-badge-circle {
    position: relative;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #009355, #007342 70%, #005a33 100%);
    box-shadow: 0 12px 28px rgba(0, 100, 55, 0.28), 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: #ffffff;
    z-index: 2;
    transition: box-shadow 0.3s ease;
}

.fh-badge-card:hover .fh-badge-circle {
    box-shadow: 0 16px 36px rgba(0, 100, 55, 0.38), 0 6px 14px rgba(0, 0, 0, 0.12);
}

.fh-badge-category {
    font-size: 13px;
    font-weight: 500;
    color: #e2f4ea;
    margin-bottom: 4px;
    line-height: 1.2;
    opacity: 0.95;
}

.fh-badge-stat {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 2px;
}

.fh-badge-unit {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    line-height: 1.15;
}

.fh-badge-desc {
    font-size: 11px;
    font-weight: 400;
    color: #e0f2e9;
    line-height: 1.35;
    max-width: 200px;
}

/* ==========================================================================
   SECTION 2: INTERACTIVE CHARTS / GRAPHS ("then have graph")
   ========================================================================== */
.fh-charts-section {
    background: #ffffff;
    border: 1px solid var(--fh-border-light);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 65px;
    box-shadow: var(--fh-shadow-md);
}

.fh-charts-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--fh-border-light);
}

.fh-charts-title-group h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--fh-text-dark);
    margin: 0 0 6px 0;
}

.fh-charts-title-group p {
    font-size: 14px;
    color: var(--fh-text-muted);
    margin: 0;
}

.fh-chart-tabs {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}

.fh-chart-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fh-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fh-chart-tab-btn:hover {
    color: var(--fh-green);
}

.fh-chart-tab-btn.active {
    background: #ffffff;
    color: var(--fh-green);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.fh-chart-view {
    display: none;
    height: 380px;
    position: relative;
    width: 100%;
}

.fh-chart-view.active {
    display: block;
}

.fh-chart-canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.fh-chart-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.fh-custom-metric-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--fh-border-light);
}

.fh-metric-dropdown,
select.fh-metric-dropdown,
.fh-custom-metric-bar select.fh-metric-dropdown {
    flex: 1;
    max-width: 520px;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: normal !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    border: 2px solid var(--fh-green) !important;
    font-size: 14px !important;
    font-family: var(--fh-font) !important;
    font-weight: 600 !important;
    color: var(--fh-green-dark) !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    outline: none !important;
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.fh-metric-dropdown option,
select.fh-metric-dropdown option {
    padding: 8px 12px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
}

.fh-metric-dropdown optgroup,
select.fh-metric-dropdown optgroup {
    font-weight: 700;
    color: var(--fh-green-dark);
    background: #f1f8f4;
}

/* ==========================================================================
   SECTION 3: 5-YEAR FINANCIAL HIGHLIGHTS TABLE (Matches Reference Image 1)
   ========================================================================== */
.fh-table-section {
    margin-bottom: 50px;
}

.fh-table-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 18px;
}

.fh-table-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.fh-table-unit-hint {
    font-size: 13px;
    color: var(--fh-text-muted);
    font-style: italic;
}

.fh-table-container {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--fh-shadow-md);
    border: 1px solid var(--fh-border-light);
}

.fh-table-scroll-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f1f8f4;
    border-bottom: 1px solid var(--fh-border-light);
    color: var(--fh-green);
    font-size: 13px;
    font-weight: 600;
}

.fh-table-scroll-hint svg {
    flex-shrink: 0;
    color: var(--fh-green);
    animation: fhSwipeHint 1.8s ease-in-out infinite;
}

@keyframes fhSwipeHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.fh-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.fh-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

/* Primary Header Row */
.fh-table thead th {
    background-color: var(--fh-green);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    text-align: right;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

.fh-table thead th:first-child {
    text-align: left;
    min-width: 320px;
    width: 40%;
    position: sticky;
    left: 0;
    z-index: 6;
    background-color: var(--fh-green);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
}

.fh-table thead th.fh-th-highlight {
    background-color: #006e3e;
    box-shadow: inset 0 -3px 0 #f0937a;
}

/* Section Header Bar (Sage / Olive Row) */
.fh-table tr.fh-section-row td {
    background-color: var(--fh-sage-bar);
    color: var(--fh-sage-text);
    font-size: 14px;
    padding: 10px 18px;
    border-top: 1px solid #b2cba7;
    border-bottom: 1px solid #b2cba7;
    position: static;
}

.fh-table tr.fh-section-row td span {
    position: sticky;
    left: 16px;
    display: inline-block;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fh-table tr.fh-section-row td.fh-td-highlight {
    background-color: #bad3af;
}

/* Standard Data Rows */
.fh-table tbody tr {
    transition: background 0.15s ease;
}

.fh-table tbody td {
    padding: 10px 18px;
    color: var(--fh-text-dark);
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid #eef2f6;
    background-color: #ffffff;
}

.fh-table tbody tr:nth-child(even) td:not(.fh-td-highlight) {
    background-color: #fafbfc;
}

.fh-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: #334155;
    white-space: normal;
    position: sticky;
    left: 0;
    z-index: 4;
    background-color: #ffffff;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05);
}

.fh-table tbody tr:nth-child(even) td:first-child:not(.fh-td-highlight) {
    background-color: #fafbfc;
}

.fh-table tbody tr:hover td {
    background-color: #f1f8f4 !important;
}

.fh-table tbody tr:hover td:first-child {
    background-color: #f1f8f4 !important;
}

/* Sub-items (indented rows like - Realised Profit) */
.fh-table tbody tr.fh-sub-row td:first-child {
    padding-left: 36px;
    font-weight: 400;
    color: #475569;
}

/* Active Highlight Column (FYE2025) */
.fh-table td.fh-td-highlight {
    background-color: var(--fh-peach-col);
    font-weight: 700;
    color: #0f172a;
    border-left: 1px solid var(--fh-peach-border);
    border-right: 1px solid var(--fh-peach-border);
}

.fh-table tbody tr:hover td.fh-td-highlight {
    background-color: #fee9dc !important;
}

/* Total / Summary Rows */
.fh-table tr.fh-total-row td {
    font-weight: 800;
    border-top: 1px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
    background-color: #f8fafc;
}

.fh-table tr.fh-total-row td.fh-td-highlight {
    background-color: #fde6d5;
}

/* Note / Disclaimer footer */
.fh-table-notes {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--fh-border-light);
    font-size: 12px;
    color: var(--fh-text-muted);
    line-height: 1.6;
}

.fh-table-notes ol {
    margin: 6px 0 0 0;
    padding-left: 18px;
}

/* ==========================================================================
   Download / Actions Bar
   ========================================================================== */
.fh-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 25px;
    padding: 20px;
    background: #f1f5f9;
    border-radius: 12px;
}

.fh-actions-info {
    font-size: 14px;
    color: #475569;
}

.fh-actions-info strong {
    color: #0f172a;
}

.fh-actions-buttons {
    display: flex;
    gap: 12px;
}

.fh-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--fh-green);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.fh-btn-primary:hover {
    background: #006e3e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 130, 75, 0.25);
    text-decoration: none;
}

.fh-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: var(--fh-text-dark) !important;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid var(--fh-border-light);
    transition: all 0.2s ease;
    cursor: pointer;
}

.fh-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    text-decoration: none;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 991px) {
    .fh-portal-wrapper {
        padding-top: 110px;
        padding-bottom: 50px;
    }

    .fh-badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px 20px;
    }
    
    .fh-hero-title {
        font-size: 28px;
    }
}

@media (max-width: 860px) {
    .fh-charts-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .fh-chart-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
        max-width: 100%;
        display: flex;
        gap: 6px;
        padding: 4px;
        box-sizing: border-box;
    }

    .fh-chart-tabs::-webkit-scrollbar {
        display: none;
    }

    .fh-chart-tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 7px 12px;
        font-size: 12.5px;
    }
}

@media (max-width: 768px) {
    .fh-container {
        padding: 0 16px;
    }

    .fh-page-hero {
        padding: 10px 0 28px 0;
    }

    .fh-charts-section {
        padding: 20px 16px;
        margin-bottom: 45px;
    }

    .fh-chart-view {
        height: 320px;
    }

    .fh-table-section {
        margin-bottom: 40px;
    }

    .fh-table-scroll-hint {
        display: flex;
    }

    .fh-table-title-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 12px;
    }

    .fh-table-title {
        font-size: 20px;
    }

    /* Responsive Sticky Column Sizing */
    .fh-table thead th:first-child,
    .fh-table tbody td:first-child {
        min-width: 175px !important;
        max-width: 185px !important;
        width: 180px !important;
        padding: 10px 12px;
        font-size: 12.5px;
        line-height: 1.35;
        white-space: normal;
        word-break: break-word;
    }

    .fh-table thead th,
    .fh-table tbody td {
        padding: 10px 12px;
        font-size: 12.5px;
        min-width: 82px;
    }

    .fh-table tr.fh-section-row td {
        font-size: 12.5px;
        padding: 9px 12px;
    }

    .fh-table tbody tr.fh-sub-row td:first-child {
        padding-left: 20px;
    }

    .fh-highlights-section {
        margin-bottom: 45px;
        padding: 10px 0;
    }

    .fh-actions-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 16px;
        padding: 18px 16px;
    }

    .fh-actions-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 13.5px;
    }

    .fh-actions-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .fh-btn-primary,
    .fh-btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
        font-size: 14px;
        box-sizing: border-box;
    }
}

@media (max-width: 640px) {
    .fh-portal-wrapper {
        padding-top: 90px;
        padding-bottom: 40px;
    }

    .fh-container {
        padding: 0 12px;
    }

    .fh-hero-title {
        font-size: 24px;
    }

    .fh-hero-subtitle {
        font-size: 13.5px;
        line-height: 1.55;
    }

    .fh-charts-section {
        padding: 16px 12px;
        margin-bottom: 35px;
    }

    .fh-charts-title-group h2 {
        font-size: 18px;
    }

    .fh-charts-title-group p {
        font-size: 13px;
    }

    .fh-chart-view {
        height: 270px;
    }

    .fh-custom-metric-bar {
        padding: 10px 12px;
        margin-bottom: 14px;
    }

    .fh-metric-dropdown,
    select.fh-metric-dropdown,
    .fh-custom-metric-bar select.fh-metric-dropdown {
        max-width: 100%;
        font-size: 13.5px !important;
    }

    .fh-badges-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .fh-badge-card {
        width: 260px;
        height: 260px;
    }
    
    .fh-badge-circle {
        width: 224px;
        height: 224px;
        padding: 16px;
    }
    
    .fh-badge-stat {
        font-size: 21px;
    }
    
    .fh-badge-unit {
        font-size: 15px;
    }

    .fh-badge-category {
        font-size: 12px;
    }

    .fh-badge-desc {
        font-size: 11px;
        line-height: 1.35;
        max-width: 185px;
    }
    
    .fh-pill-header-container {
        margin-bottom: 25px;
    }

    .fh-pill-header {
        font-size: 15px;
        padding: 6px 14px 6px 18px;
        max-width: 100%;
    }
    
    .fh-pill-header-text {
        font-size: 15.5px;
    }

    .fh-pill-header-icon {
        width: 36px;
        height: 20px;
    }

    .fh-pill-header-icon::after {
        width: 11px;
        height: 11px;
    }
}

@media (max-width: 360px) {
    .fh-badge-card {
        width: 236px;
        height: 236px;
    }

    .fh-badge-circle {
        width: 204px;
        height: 204px;
        padding: 12px;
    }

    .fh-badge-stat {
        font-size: 19px;
    }

    .fh-badge-unit {
        font-size: 14px;
    }

    .fh-badge-desc {
        font-size: 10.5px;
        max-width: 170px;
    }

    .fh-pill-header-text {
        font-size: 14px;
    }

    .fh-table thead th:first-child,
    .fh-table tbody td:first-child {
        min-width: 155px !important;
        max-width: 165px !important;
        width: 160px !important;
        font-size: 12px;
    }

    .fh-table thead th,
    .fh-table tbody td {
        min-width: 75px;
        font-size: 12px;
        padding: 8px 10px;
    }
}
