/* ==========================================================================
   ANNUAL GENERAL MEETINGS & CORPORATE ANNOUNCEMENTS PORTAL
   ENEST Group Berhad - Investor Relations
   Matches Reference Corporate Design & Modern Premium Aesthetics
   ========================================================================== */

:root {
    --agm-brand-dark: #7a4616;
    --agm-brand: #9d6125;
    --agm-brand-light: #c8842d;
    --agm-brand-subtle: #fbf5ee;
    --agm-brand-hover: #f5eae0;
    --agm-brand-border: #dfc5ab;
    --agm-green-dark: #7a4616;
    --agm-green: #9d6125;
    --agm-green-light: #c8842d;
    --agm-green-subtle: #fbf5ee;
    --agm-green-hover: #f5eae0;
    --agm-green-border: #dfc5ab;
    --agm-text-dark: #0f172a;
    --agm-text-body: #334155;
    --agm-text-muted: #64748b;
    --agm-bg-light: #f8fafc;
    --agm-border-color: #f1f5f9;
    --agm-border-card: #e2e8f0;
    --agm-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --agm-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
    --agm-shadow-hover: 0 14px 34px rgba(157, 97, 37, 0.12);
    --agm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --agm-radius-card: 16px;
    --agm-radius-sm: 8px;
}

/* Base Wrapper */
.agm-portal-wrapper {
    font-family: var(--agm-font);
    color: var(--agm-text-body);
    line-height: 1.5;
    background: #ffffff;
    padding-top: 140px;
    padding-bottom: 70px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

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

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

/* ==========================================================================
   Hero Banner / Header Section
   ========================================================================== */
.agm-hero-section {
    text-align: center;
    padding: 10px 0 35px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.agm-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--agm-green-subtle);
    color: var(--agm-green);
    padding: 6px 18px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
    border: 1px solid rgba(157, 97, 37, 0.2);
}

.agm-hero-badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.agm-hero-title {
    font-size: 38px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.25 !important;
    text-align: center !important;
    letter-spacing: -0.5px !important;
}

.agm-hero-subtitle {
    font-size: 16px;
    color: var(--agm-text-muted);
    max-width: 760px;
    margin: 0 auto 20px auto !important;
    text-align: center !important;
    line-height: 1.6;
}

/* Navigation Breadcrumbs / Switcher */
.agm-nav-pill-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.agm-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--agm-text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    background: #f1f5f9;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.agm-nav-link:hover {
    color: var(--agm-green);
    background: var(--agm-green-subtle);
}

.agm-nav-link.active {
    background: var(--agm-green);
    color: #ffffff;
}

/* ==========================================================================
   Filter & Search Toolbar
   ========================================================================== */
.agm-toolbar-container {
    background: #ffffff;
    border: 1px solid var(--agm-border-card);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: var(--agm-shadow-sm);
    margin-bottom: 35px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.agm-tab-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}

.agm-tab-btn {
    border: none;
    background: transparent;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--agm-text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.agm-tab-badge {
    background: rgba(157, 97, 37, 0.12);
    color: var(--agm-green);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.agm-search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 380px;
}

.agm-search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--agm-border-card);
    border-radius: 10px;
    font-size: 14px;
    color: var(--agm-text-dark);
    background: #ffffff;
    transition: all 0.2s ease;
    outline: none;
}

.agm-search-box input:focus {
    border-color: var(--agm-green);
    box-shadow: 0 0 0 3px rgba(157, 97, 37, 0.15);
}

.agm-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--agm-text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.agm-search-icon svg {
    width: 16px;
    height: 16px;
}

/* Year Filter Chips */
.agm-filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.agm-filter-label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--agm-text-dark);
    margin-right: 4px;
}

.agm-chip {
    border: 1px solid var(--agm-border-card);
    background: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--agm-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.agm-chip:hover {
    border-color: var(--agm-green-border);
    color: var(--agm-green);
    background: var(--agm-green-subtle);
}

.agm-chip.active {
    background: var(--agm-green);
    color: #ffffff;
    border-color: var(--agm-green);
}

/* ==========================================================================
   Cards Grid (3 Columns Matching Reference Image)
   ========================================================================== */
.agm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 50px;
}

@media (max-width: 1024px) {
    .agm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
}

@media (max-width: 680px) {
    .agm-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .agm-hero-title {
        font-size: 28px;
    }
    .agm-toolbar-container {
        flex-direction: column;
        align-items: stretch;
    }
    .agm-search-box {
        max-width: 100%;
    }
}

/* Individual Meeting Card */
.agm-card {
    background: #ffffff;
    border: 1px solid #eaedf1;
    border-radius: var(--agm-radius-card);
    padding: 28px 24px;
    box-shadow: var(--agm-shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.agm-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--agm-shadow-hover);
    border-color: rgba(157, 97, 37, 0.35);
}

.agm-card-header {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.agm-card-title {
    color: #9d6125 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.2px !important;
}

.agm-card-badge {
    background: var(--agm-green-subtle);
    color: var(--agm-green-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid var(--agm-green-border);
}

/* Document Item List inside Card */
.agm-doc-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.agm-doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 8px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none !important;
    transition: background-color 0.15s ease, padding-left 0.15s ease;
    border-radius: 8px;
    cursor: pointer;
}

.agm-doc-item:last-child {
    border-bottom: none;
    padding-bottom: 6px;
}

.agm-doc-item:hover {
    background-color: #f8fafc;
    padding-left: 12px;
}

/* PDF Icon Styled to Match Reference Image */
.agm-doc-icon-wrap {
    flex-shrink: 0;
    width: 38px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.agm-pdf-svg {
    width: 36px;
    height: 42px;
    filter: drop-shadow(0 2px 4px rgba(157, 97, 37, 0.12));
    transition: transform 0.2s ease;
}

.agm-doc-item:hover .agm-pdf-svg {
    transform: scale(1.06);
}

/* Document Details Text */
.agm-doc-details {
    flex: 1;
    min-width: 0;
}

.agm-doc-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 5px 0;
    line-height: 1.35;
    word-break: break-word;
    transition: color 0.15s ease;
}

.agm-doc-item:hover .agm-doc-title {
    color: var(--agm-green);
}

.agm-doc-date {
    font-size: 13.5px;
    font-weight: 600;
    color: #9d6125;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agm-doc-size {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--agm-text-muted);
}

/* Action Icons / Hover Arrow */
.agm-doc-action {
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    color: var(--agm-green);
    display: flex;
    align-items: center;
}

.agm-doc-item:hover .agm-doc-action {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   Financial Results Tab Section (FA,FRCO)
   ========================================================================== */
.agm-fa-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .agm-fa-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .agm-fa-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Document Preview Modal (Custom Element with Body Scroll Lock)
   ========================================================================== */
body.agm-modal-open {
    overflow: hidden !important;
    touch-action: none !important;
}

.agm-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.agm-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.agm-modal-window {
    background: #ffffff;
    width: 100%;
    max-width: 960px;
    height: 85vh;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.agm-modal-backdrop.active .agm-modal-window {
    transform: scale(1) translateY(0);
}

.agm-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--agm-border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.agm-modal-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.agm-modal-icon {
    width: 32px;
    height: 38px;
    flex-shrink: 0;
}

.agm-modal-titles {
    min-width: 0;
}

.agm-modal-h3 {
    margin: 0 0 3px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--agm-text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

.agm-modal-meta {
    margin: 0;
    font-size: 13px;
    color: var(--agm-text-muted);
}

.agm-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agm-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--agm-green);
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.agm-btn-download:hover {
    background: var(--agm-green-dark);
}

.agm-modal-close-btn {
    border: none;
    background: #f1f5f9;
    color: var(--agm-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agm-modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.agm-modal-body {
    flex: 1;
    position: relative;
    background: #525659;
}

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

/* Custom Toast Notification */
.agm-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.agm-toast {
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: agmToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.agm-toast svg {
    width: 18px;
    height: 18px;
    color: #10b981;
    flex-shrink: 0;
}

@keyframes agmToastIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
