@import 'theme.css';

/* --- MULTI-PANE HORIZONTAL ENGINE LAYOUT --- */
.app-container {
    width: 100%;
    max-width: 1350px; /* Expanded max-width limit to fit double columns comfortably */
    display: flex;
    flex-direction: row;
    gap: 15px; /* Gutter space between input tables and analytics panels */
    margin: 10px auto;
    box-sizing: border-box;
    padding-right: 40px;
}

/* Base parameters for both side panels */
.dashboard-pane {
    background: var(--color-card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Wide inputs layout pane */
.left-pane {
    flex: 0 0 50%; /* Allocates exactly 60% view window width scale */
    border-top: 8px solid var(--color-primary-navy);
}

/* Snappy analytics output layout pane */
.right-pane {
    flex: 0 0 50%; /* Allocates exactly 40% view window width scale */
    border-top: 8px solid var(--color-secondary-slate);
    position: sticky; /* Keeps output tracking values anchored on screen while scrolling rows */
    top: 20px;
    height: fit-content;
}

/* Global master header styling properties */
/* --- MULTI-PANE CENTRED TOP SYSTEM HEADER LAYOUT --- */
.app-header {
    max-width: 1350px; /* Perfectly matches the max-width of your two-pane layout container */
    width: 100%;
    margin: 20px auto 20px auto; /* Centers the header box container in the browser window */
    padding: 0 0 15px 0;
    border-bottom: 2px solid var(--color-primary-navy);
    text-align: center; /* Centrally aligns the title and sub-title typography fields */
    box-sizing: border-box;
}

.app-header h1 {
    color: var(--color-primary-navy);
    margin: 0;
    font-size: 26px; /* Slightly upscaled for centralized prominence */
    font-weight: 700;
}

.app-header p {
    color: var(--color-muted-gray);
    font-style: italic;
    margin: 6px 0 0 0;
    font-size: 14px;
}

.section-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--color-primary-navy);
    text-transform: uppercase;
    margin: 20px 0 10px 0;
    border-bottom: 2px solid var(--color-light-border);
    padding-bottom: 4px;
}

.matrix-grid-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: #f8fafc;
    border-radius: 10px;
    overflow: visible !important;
    border: 1px solid var(--color-light-border);
}

.matrix-grid-table th {
    background: var(--color-secondary-slate);
    color: white;
    padding: 12px 10px;
    font-size: 13px;
    text-align: left;
}

.matrix-grid-table td {
    padding: 10px;
    border-bottom: 1px solid #cbd5e1;
    vertical-align: middle;
    overflow: visible !important;
}

.control-header-flex-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #cbd5e1;
    margin-bottom: 15px;
    padding-bottom: 6px;
    flex-wrap: wrap;
    gap: 15px;
}

.matrix-title-text {
    font-size: 14px;
    font-weight: bold;
    color: var(--color-primary-navy);
    text-transform: uppercase;
}

.info-guide-trigger {
    cursor: pointer;
    color: var(--color-primary-navy);
    margin-left: 8px;
    font-size: 13px;
    text-transform: none;
    font-weight: bold;
}

.control-inputs-right-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

.horizontal-input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.horizontal-input-group label {
    font-size: 13px;
    margin: 0;
    white-space: nowrap;
    font-weight: 600;
    color: var(--color-muted-gray);
}

.horizontal-input-group input {
    width: 85px;
    padding: 4px 6px;
    font-weight: bold;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

#mf_swp_term {
    width: 45px;
    text-align: center;
}

.action-refresh-icon {
    font-size: 18px;
    background: transparent;
    border: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    opacity: 0.3;
    cursor: not-allowed;
}

.add-matrix-row-btn {
    background-color: var(--color-card-bg);
    color: var(--color-primary-navy);
    border: 2px dashed var(--color-primary-navy);
    padding: 10px 24px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 5px;
    margin-bottom: 25px;
    width: 100%;
    transition: all 0.2s ease;
}

.add-matrix-row-btn:hover {
    background-color: #f0f4f8;
}

.add-matrix-row-btn.secondary-btn {
    border-color: var(--color-muted-gray);
    color: var(--color-muted-gray);
    margin-bottom: 30px;
}

.live-tracker-title-flex-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 2px solid var(--color-primary-navy);
    margin-top: 35px;
    margin-bottom: 15px;
    padding-bottom: 8px;
}

.material-tabs-wrapper {
    display: flex;
    background: #e2e8f0;
    border-radius: 20px;
    padding: 3px;
    gap: 4px;
    border: 1px solid #cbd5e1;
}

.material-tab-item {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 17px;
    transition: all 0.2s ease;
}

.material-tab-item.active {
    background: var(--color-card-bg);
    color: var(--color-primary-navy);
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Stack summary cards cleanly in one row file inside the narrow right pane */
.summary-dashboard {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin: 20px 0;
}

.summary-card {
    background: var(--color-hud-green-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--color-hud-green-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card.blue-variant {
    background: var(--color-hud-blue-bg);
    border-color: var(--color-hud-blue-border);
}

.summary-card.slate-variant {
    background: var(--color-hud-slate-bg);
    border-color: var(--color-hud-slate-border);
}

.summary-card h2 {
    margin: 0;
    font-size: 12px;
    color: var(--color-muted-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card p {
    margin: 8px 0 0 0;
    font-size: 22px;
    font-weight: bold;
    color: var(--color-dark-charcoal);
}

.diagram-section {
    border-top: 2px dashed #cbd5e1;
    padding-top: 20px;
}

.timeline-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.timeline-btn {
    background: var(--color-card-bg);
    color: var(--color-muted-gray);
    border: 2px solid #cbd5e1;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-btn.active {
    background: var(--color-muted-gray);
    color: var(--color-card-bg);
    border-color: var(--color-muted-gray);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.diagram-display-box {
    background: #1e293b;
    color: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    font-family: var(--font-stack-mono);
    min-height: 180px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

.flow-node {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid #334155;
    padding-bottom: 8px;
}

.flow-node:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.flow-label {
    color: #94a3b8;
}

.flow-val {
    color: #38bdf8;
    font-weight: bold;
}

.flow-val.green {
    color: #4ade80;
}

.search-wrapper-relative {
    position: relative;
    width: 100%;
}

/* --- ENHANCED HIGH-CONTRAST DROPDOWN LAYER Portal --- */
.suggestions-dropdown-box {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 95% !important;
    background-color: var(--color-card-bg) !important;
    border: 2px solid var(--color-primary-navy) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25) !important; /* Heavy elevation shadow */
    z-index: 99999999 !important; /* Forces dropdown layer above layout columns */
    max-height: 200px !important;
    overflow-y: auto !important;
    display: none;
    box-sizing: border-box !important;
    padding: 4px 0 !important; /* Generates a comfortable inner tracking viewport breathing buffer */
    margin: 4px 0 0 0 !important;
}

/* --- SEPARATE MUTUAL FUND ENTRY ROW PLAN CARDS --- */
.search-suggestion-item {
    padding: 12px 14px !important; /* Increased padding hit box sizes for seamless mouse selection */
    color: var(--color-dark-charcoal) !important; /* Stark charcoal black for absolute reading legibility */
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: left !important;
    background-color: var(--color-card-bg) !important;
    cursor: pointer !important;
    white-space: normal !important; /* Forces long corporate scheme titles to wrap lines cleanly */
    
    /* CRITICAL DISTINCTION: Inserts a clear, crisp structural divider line between fund records */
    border-bottom: 1px solid var(--color-light-border) !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Clear out duplicate border line parameter tracks on the final item row card block */
.search-suggestion-item:last-child {
    border-bottom: none !important;
}

/* --- ACTIVE ACTION SELECTION GLOW HOVER FIELDS --- */
.search-suggestion-item:hover {
    /* FIXED: Forces an immediate, high-contrast corporate blue focus window mask */
    background-color: var(--color-primary-navy) !important;
    color: var(--color-card-bg) !important; /* Flips text color to solid white to keep contrast razor sharp */
}

/* Modal Stacking Elements Styles */
.modal-backdrop-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content-card {
    background: var(--color-card-bg);
    max-width: 850px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    overflow: hidden;
    border-top: 6px solid var(--color-primary-navy);
}

.modal-header-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-light-border);
}

.modal-header-strip h3 {
    margin: 0;
    color: var(--color-primary-navy);
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

.modal-close-cross-btn {
    cursor: pointer;
    font-size: 24px;
    color: #64748b;
    font-weight: bold;
    line-height: 1;
}

.modal-body-scroller {
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-guide-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}

.modal-guide-data-table th {
    background: var(--color-secondary-slate);
    color: #ffffff;
    padding: 10px;
}

.modal-guide-data-table td {
    padding: 10px;
    border-bottom: 1px solid var(--color-light-border);
}

/* --- MOBILE RESPONSIVE ADAPTER GATES --- */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column; /* Force vertical row stacking on laptops and mobile viewports */
    }
    .left-pane, .right-pane {
        flex: 1 1 100%;
        position: static;
    }
}
