/* Main container layout */
.main-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    background-color: #f8f9fa;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Balance content layout */
.balance-content {
    display: flex;
    flex-direction: row;
    padding: 2em;
    width: 80%;
    background-color: #f8f9fa;
    overflow: visible;
}

.balance-content h1 {
    color: #2c3e50;
    margin-bottom: 1.5em;
    font-size: 2em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5em;
}

/* Grid layout for balance items */
.a0 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5em;
    width: 100%;
    margin: 0;
}

/* Category styling */
.category {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 0.5em;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}
/**
* Category header styling
* This is the header for the category
* It contains the category name and the total value
* It is used to display the category name and the total value
* It was added on 18.10 to accomodate sums on each financial statement category
*/
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.4em;
    margin-top: 0.4em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0.5em;
}

.category-header:hover {
    background-color: #f8f9fa;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.category h2 {
    color: #2c3e50;
    font-size: 1.3em;
    margin: 0;
}

.category-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

/* Main category styling */
.main-category {
    margin: 1em 0;
    width: 100%;
}

/**
* Main category header styling
* This is the header for the main category
* It contains the main category name and the total value
* It is used to display the main category name and the total value
* It was added on 18.10 to accomodate sums on each financial statement category
*/
.main-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    cursor: pointer;
    border-radius: 0.5em;
}

.main-category-header:hover {
    background-color: #f8f9fa;
}

.main-category h3 {
    color: #34495e;
    font-size: 1.1em;
    margin: 0;
}

.main-category-value {
    font-weight: 600;
    color: #34495e;
    font-size: 1em;
}


/* Sub-category styling */

.sub-category {
    background-color: #f4f6fb;
    border-radius: 6px;
    padding: 0.5em;
    margin: 0.5em 0;
    transition: background-color 0.2s ease;
    overflow: visible;
    cursor: pointer;
}

.sub-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-category:hover {
    background-color: #e9ecef;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1em;
}

.sub-category-header h4 {
    color: #34495e;
    font-size: 1em;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.expand-icon {
    color: #bdc3c7;
    font-size: 0.8em;
    transition: transform 0.2s ease;
    display: inline-block;
    transform: rotate(90deg);
}

.category-content {
    margin-top: 1em;
    padding-left: 1.5em;
}

.sub-category-content {
    margin-top: 1em;
    padding-top: 1em;
    padding-left: 1em;
    border-top: 1px solid #e9ecef;
    overflow: visible;
}

/* Detail styling */
.detail {
    margin: 0.7em 0;
}

.detail h4 {
    color: #7f8c8d;
    font-size: 1em;
    margin-bottom: 0.4em;
}



/* Individual item styling */
.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4em 0.7em;
    background-color: #fff;
    border-radius: 4px;
    margin-bottom: 0.2em;
    border: 1px solid #e9ecef;
    min-width: 200px;
}

/* Form input styling */
input:read-only {
    background: #e3f2fd;
}

input:read-only:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Accounts list styling */
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin: 1em 0;
}

.account-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.account-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em;
    cursor: pointer;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.account-header:hover {
    background-color: #e9ecef;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.account-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.account-description {
    color: #6c757d;
    font-size: 0.9em;
}

.account-summary {
    display: flex;
    align-items: center;
    gap: 1em;
}

.account-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.account-items {
    padding: 0;
    background-color: #fff;
}

.transaction-item {
    padding: 0.75em 1em;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.transaction-item:hover {
    background-color: #f8f9fa;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.transaction-date {
    font-weight: 500;
    color: #495057;
}

.transaction-value {
    font-weight: 600;
    color: #2c3e50;
}

.transaction-details {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
}

.detail-item {
    font-size: 0.85em;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 0.25em 0.5em;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    align-items: left;
    height: 100%;
    overflow: hidden;
    white-space: nowrap;
}

table {
    width: 100%;
}

.table-header tr {
    display: flex;
    justify-content: space-between;
    background-color: #fff;
    border-spacing: 0.3em;
    padding: 0.4em 0.7em;
}

.table-header th {
    flex: 1;
}

.table-details {
    display: flex;
    justify-content: space-between;
    padding: 0.4em 0.7em;
    background-color: #fff;
    border-spacing: 0.3em;
    gap: 1em
}

.table-details td {
    flex: 1;
}

/* Ensure the parent container doesn't clip content */
.balance-content {
    overflow: visible;
}

.category {
    overflow: visible;
}

.sub-category {
    overflow: visible;
}

.sub-category-content {
    overflow: visible;
}

.balance-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.loading-message, .error-message, .no-data-message {
    padding: 20px;
    text-align: center;
    font-size: 16px;
}

.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    border-radius: 4px;
}

.balance-content h1 {
    margin-bottom: 30px;
    color: #333;
}

.flexbox-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
}

.balance-section,
.pnl-section {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
    padding: 1.5em;
    width: 50%;
}

.section-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.balance-subsection {
    margin-bottom: 2em;
}

.subsection-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

/* Responsive design - stack vertically on smaller screens */
@media (max-width: 1200px) {
    .flexbox-container {
        flex-direction: column;
    }
}

/* =============================================================================
   P&L RESULT DISPLAY STYLES
   ============================================================================= */

.pnl-result-container {
    margin-top: 0.6em;
    padding: 0.3em 0;
}

.pnl-result-card {
    background: white;
    border-radius: 8px;
    padding: 0.45em 0.6em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid #007bff;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pnl-result-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Profit - Green to Blue gradient */
.pnl-result-card.profit {
    background: linear-gradient(135deg, #11998e 0%, #007bff 100%);
    color: white;
    border: none;
}

/* Loss - White background with blue outline */
.pnl-result-card.loss {
    background: white;
    color: #333;
    border: 2px solid #007bff;
}

/* Neutral - White background with blue outline */
.pnl-result-card.neutral {
    background: white;
    color: #333;
    border: 2px solid #007bff;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* For profit cards with gradient background */
.pnl-result-card.profit .result-header {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.result-title {
    margin: 0;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.result-badge {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    color: #007bff;
    padding: 0.2em 0.5em;
    border-radius: 10px;
    font-size: 0.6em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25em;
    white-space: nowrap;
}

/* Badge styling for profit cards */
.pnl-result-card.profit .result-badge {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.result-badge i {
    font-size: 0.85em;
}

.result-value {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.2em 0;
    text-shadow: none;
}

/* Text shadow only for profit cards */
.pnl-result-card.profit .result-value {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.result-sign {
    margin-right: 0.1em;
    font-size: 0.7em;
}

.result-amount {
    font-variant-numeric: tabular-nums;
}

.result-currency {
    font-size: 0.5em;
    margin-left: 0.3em;
    font-weight: 500;
    opacity: 0.8;
}

.result-description {
    text-align: center;
    font-size: 0.65em;
    opacity: 0.75;
    font-style: italic;
    margin-top: 0.3em;
}

/* Animation for value changes */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.result-value.updated {
    animation: pulse 0.5s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3em;
    }
    
    .result-value {
        font-size: 1.3em;
    }
    
    .result-badge {
        font-size: 0.55em;
    }
    
    .result-title {
        font-size: 0.75em;
    }
}