/* --- CSS Variables --- */
:root {
    --nav-menu-width: 240px;
    --content-padding-top-desktop: 75px;
    --picker-menu-width-desktop: 350px;
    --primary-color: #007bff;
    --primary-color-dark: #005bb5;
    /* Added from our previous CSS for 2-column layouts */
    --right-column-max-width: 840px; 
    --right-column-min-width: 400px; 
}

/* General Reset and Base Styling */
body, html, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption,
tbody, tfoot, thead, tr, th, td, article,
aside, canvas, details, embed, figure,
figcaption, footer, header, hgroup, menu,
nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Body styling */
body {
    line-height: 1;
    font-family: 'Open Sans', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* Navigation Menu Styling */
.nav-menu {
    background-color: #ececec;
    padding: 20px;
    width: var(--nav-menu-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;
    z-index: 100; 
}

.nav-menu__logo { font-size: 28px; font-weight: bold; margin-bottom: 30px; text-align: left; color: #0057b8; }
.nav-menu__links ul { list-style-type: none; padding: 0; margin: 0; }
.nav-menu__item { margin-bottom: 15px; }
.nav-menu__link { display: block; padding: 12px 20px; text-decoration: none; color: #ffffff; font-size: 16px; transition: background-color 0.3s, transform 0.2s; border-radius: 8px; background-color: var(--primary-color); text-align: left; }
.nav-menu__link:hover { background-color: var(--primary-color-dark); transform: translateY(-2px); }
.nav-menu__link.active { background-color: var(--primary-color-dark); color: #ffffff; }

/* Main Content Area Styling */
.content {
    display: flex;
    flex-direction: row; 
    gap: 20px;
    margin-left: var(--nav-menu-width);
    padding: 40px;
    padding-top: var(--content-padding-top-desktop); 
    background-color: #f8f9fa;
    width: calc(100% - var(--nav-menu-width));
    height: 100vh; 
    overflow-y: hidden; 
    overflow-x: auto; /* Added for safety if content is too wide */
    box-sizing: border-box;
}

/* --- Picker Menu (for Flow & Identity) --- */
.picker-menu {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: var(--picker-menu-width-desktop); 
    flex-shrink: 0; 
    height: 100%; 
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
    gap: 10px; /* <-- MODIFIED */
}

.picker-menu h2 { font-size: 1.5em; margin-top: 0; margin-bottom: 20px; color: var(--primary-color); }
.picker-menu .form-group {
    margin-bottom: 0; /* <-- MODIFIED */
    text-align: left;
}
.picker-menu label { font-weight: bold; display: block; margin-bottom: 5px; font-size: 14px; }

/* Merged rule for all form inputs in picker */
.picker-menu select,
.picker-menu .form-control { 
    width: 100%; 
    padding: 10px; /* Standardized padding */
    font-size: 1em; 
    border-radius: 6px; 
    border: 1px solid #ccc;
    background-color: #fff;
    box-sizing: border-box;
}
.picker-menu .form-control[readonly] { background-color: #f0f0f0; cursor: not-allowed; }

.picker-menu .button-container { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.picker-menu button { 
    background-color: var(--primary-color); 
    color: #ffffff; 
    padding: 12px 24px; /* Standardized padding */
    border: none; 
    border-radius: 8px; /* Standardized radius */
    font-size: 16px; /* Standardized font size */
    cursor: pointer; 
    flex: 1; /* Make buttons in container share space */
    transition: background-color 0.3s; 
}
.picker-menu button:hover { background-color: var(--primary-color-dark); }

/* --- Wrapper for the 3-Column Layout (Flow & Identity) --- */
.payment-and-log-wrapper {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    min-width: 0;
    height: 100%;
}

/* --- Middle Column (Flow & Identity) --- */
#display-div {
    flex: 2; /* Takes 2/3 of the space */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: auto; 
    height: 100%; 
    min-width: 0;
}

/* --- Right Column (Flow & Identity) --- */
.event-log-panel {
    flex: 1; /* Takes 1/3 of the space */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow-y: auto;
    min-width: 250px; 
}
.event-log-panel h3 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.2em;
}
#event-log {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
    min-height: 400px; /* Added min-height */
}

/* --- Right Column (FOR 2-COLUMN PAGES like Fullcard, Request-Generator) --- */
/* This is the generic right column for 2-COLUMN pages */
.main-content,
.json-display,
#main-content {
    flex-grow: 1;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow-y: auto;
    min-width: var(--right-column-min-width);
    max-width: var(--right-column-max-width);
    text-align: left;
}
.json-display { display: flex; flex-direction: column; }


/* --- Other Component Styles (Merged) --- */

/* Success Message Styling (from flow.css) */
.success-message { background-color: #ffffff; padding: 40px; border-radius: 10px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); margin: 20px auto; width: 100%; max-width: 600px; }
.success-message h1 { color: var(--primary-color); font-size: 2em; margin-bottom: 20px; text-align: left; }
.success-message p { font-size: 1.2em; margin-bottom: 20px; text-align: left; }
.success-message .payment-info { background-color: #f5f5f5; padding: 20px; border-radius: 8px; margin-bottom: 20px; text-align: left; }
.success-message .buttons-container { display: flex; justify-content: space-between; gap: 10px; }
.success-message .dashboard-button { background-color: var(--primary-color); color: white; border: none; padding: 10px 20px; border-radius: 5px; font-size: 1em; cursor: pointer; }
.success-message .dashboard-button:hover { background-color: var(--primary-color-dark); }

/* Payload Helper and Modal Styling (from flow.css) */
#payload-helper { display: inline-block; background-color: #e0e0e0; color: #333; font-size: 0.8em; width: 22px; height: 22px; border-radius: 50%; text-align: center; line-height: 22px; cursor: pointer; font-weight: bold; transition: background-color 0.3s; vertical-align: middle; }
#payload-helper:hover { background-color: #007bff; color: #fff; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal-content { background-color: #fefefe; padding: 20px 30px; border-radius: 8px; width: 80%; max-width: 700px; position: relative; box-shadow: 0 4px 15px rgba(0,0,0,0.2); animation: fadeIn 0.3s; }
.modal-close-button { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; }
.modal-close-button:hover, .modal-close-button:focus { color: black; text-decoration: none; cursor: pointer; }
#payload-pre { background-color: #f4f4f4; border: 1px solid #ddd; border-radius: 4px; padding: 15px; max-height: 60vh; overflow-y: auto; white-space: pre-wrap; word-break: break-all; font-family: 'Courier New', Courier, monospace; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Styles for 'Events' page (from previous CSS) */
.events-container { display: flex; flex: 1; gap: 20px; height: 100%; }
#sidebar { 
    width: 350px; background-color: #ffffff; padding: 20px; border-radius: 10px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); overflow-y: auto; height: 100%; flex-shrink: 0; 
}
#sidebar h2 { font-size: 1.5em; color: var(--primary-color); margin-bottom: 20px; margin-top: 0; }
#event-list { list-style: none; padding: 0; }
.event-item { 
    padding: 10px; margin: 10px 0; cursor: pointer; background-color: #f9f9f9; 
    border-radius: 10px; transition: background-color 0.3s ease; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.event-item:hover { background-color: #f1f1f1; }
.event-details { 
    background: #fff; padding: 30px; border-radius: 10px; max-width: 100%; 
    overflow-wrap: break-word; box-shadow: none; border: 1px solid #ddd; 
}
.event-details h3 { font-size: 1.2em; color: var(--primary-color); margin-top: 0; }
.event-details p { margin: 5px 0; }
.event-details p strong { font-weight: bold; }

/* Other component styles (accordion, omnibox, etc.) */
.transaction-heading { font-weight: bold; padding: 10px 0; font-size: 1.2em; margin-bottom: 10px; margin-top: 0; }
pre { background-color: #f9f9f9; padding: 20px; border-radius: 8px; border: 1px solid #ddd; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.05); flex: 1; overflow: auto; }
.accordion-container { display: flex; gap: 10px; margin-top: 20px; }
.accordion { width: 50%; padding: 10px 15px; text-align: center; background-color: var(--primary-color); color: #fff; border: none; outline: none; border-radius: 5px; font-size: 14px; cursor: pointer; position: relative; transition: background-color .3s ease, color .3s ease; margin-top: 10px; }
.accordion:hover { background-color: var(--primary-color-dark); }
.accordion::after { content: '\25BC'; font-size: 12px; color: #fff; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); transition: transform .3s ease; }
.accordion.active::after { transform: translateY(-50%) rotate(180deg); }
.panel { display: none; padding: 15px; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 10px; margin-top: 15px; }
.panel pre { padding: 10px; background-c_message_idxolor: #f9f9f9; border-radius: 8px; white-space: pre-wrap; overflow-x: auto; line-height: 1.4; }
.omnibox-container { position: relative; display: flex; align-items: center; width: 100%; margin-bottom: 20px; }
#search-omnibox { width: 100%; padding: 10px 40px 10px 10px; font-size: 1em; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); outline: none; transition: box-shadow .3s ease, border-color .3s ease; }
#search-omnibox::placeholder { color: #999; font-style: italic; }
#search-omnibox:focus { box-shadow: 0 0 5px rgba(0,123,255,.5); border-color: var(--primary-color); }
#omnibox-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; }

/* Homepage Styles (from previous CSS) */
.home-page .content { justify-content: center; align-items: center; text-align: center; }
.welcome-container { background-color: #ffffff; padding: 50px 60px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); max-width: 600px; }
.welcome-icon { color: var(--primary-color); margin-bottom: 20px; }
.welcome-title { font-size: 2.25em; font-weight: 600; color: #333; margin-bottom: 15px; }
.welcome-subtitle { font-size: 1.125em; color: #6c757d; line-height: 1.6; margin-bottom: 30px; }
.cta-button { display: inline-block; padding: 14px 28px; font-size: 1em; font-weight: 600; color: #ffffff; background-color: var(--primary-color); text-decoration: none; border-radius: 8px; transition: background-color 0.3s, transform 0.2s; }
.cta-button:hover { background-color: var(--primary-color-dark); transform: translateY(-2px); }
.welcome-text { display: none; }

/* Scrollbar Hiding (Merged from all sources) */
#sidebar::-webkit-scrollbar, 
#main-content::-webkit-scrollbar, 
.json-display::-webkit-scrollbar, 
.picker-menu::-webkit-scrollbar, 
.main-content::-webkit-scrollbar, 
#display-div::-webkit-scrollbar, 
.event-log-panel::-webkit-scrollbar { 
    width: 0px; 
    background: transparent; 
}
#sidebar, 
#main-content, 
.json-display, 
.picker-menu, 
.main-content, 
#display-div, 
.event-log-panel { 
    scrollbar-width: none; 
}

/* --- RESPONSIVE STYLING (Merged) --- */

/* For 3-column layout (flow, identity) */
@media (max-width: 1200px) {
    .payment-and-log-wrapper {
        flex-direction: column;
        height: auto;
    }
    #display-div, .event-log-panel {
        min-height: 300px;
        height: auto;
    }
}

/* For 2-column layout & 3-column stacking */
@media (max-width: 1024px) { 
    .content {
        flex-direction: column;
        overflow-y: auto; 
        height: auto; 
    }
    .picker-menu {
        margin-bottom: 20px; 
        height: auto;
    }
    /* Targets any right-hand column */
    .main-content,
    .json-display,
    #main-content,
    #display-div,
    .payment-and-log-wrapper {
        height: auto;
    }
}

/* For Mobile (all pages) */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow: auto;
    }
    .nav-menu {
        display: none; 
    }
    .content {
        margin-left: 0;
        width: 100%;
        padding: 20px; 
    }

    /* Make all main content columns full-width */
    .picker-menu,
    .json-display,
    #sidebar,
    #main-content,
    .main-content,
    #display-div,
    .payment-and-log-wrapper { 
        width: 100% !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-right: 0;
        margin-bottom: 20px;
        height: auto;
        overflow-y: visible;
    }

    /* Remove margin from the last item in the column */
    .picker-menu:last-child,
    .json-display:last-child,
    #sidebar:last-child,
    #main-content:last-child,
    .main-content:last-child,
    #display-div:last-child,
    .payment-and-log-wrapper:last-child {
        margin-bottom: 0;
    }
    
    .event-log-panel {
        margin-top: 20px;
    }

    pre {
        overflow-x: auto;
    }
}

/* Your other styles from flow.css */
div[id*="AccordionPanel"] {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}