/* CapTableau SPA Styles */

/* Dashboard Styles */
.dashboard-view {
    padding: 15px;
}

/* Date Range Selector Styles */
.date-range-selector {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f7f7f7;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.date-picker-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.date-picker-container label {
    font-weight: 500;
    margin-right: 5px;
}

.date-picker-container .k-datepicker {
    width: 180px;
}

#apply-date-filter {
    margin-left: auto;
}

/* Financial Summary Cards */
.financial-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    display: flex;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    font-size: 24px;
}

.total-assets .card-icon {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.total-liabilities .card-icon {
    background-color: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

.net-worth .card-icon {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.allocation-efficiency .card-icon {
    background-color: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.card-content {
    flex: 1;
}

.card-content h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #555;
}

.metric {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

/* Loan Payoff Projection */
.loan-payoff-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.loan-payoff-controls label {
    font-weight: 500;
}

.loan-payoff-controls .k-datepicker {
    width: 180px;
}

.loan-payoff-controls .k-dropdown {
    min-width: 260px;
}

.loan-payoff-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.loan-payoff-result {
    padding: 12px;
    border-radius: 6px;
    background-color: #f7f7f7;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loan-payoff-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loan-payoff-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.loan-payoff-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 4px;
}

.change-indicator {
    font-size: 14px;
    font-weight: 500;
}

.positive-change {
    color: #4CAF50;
}

.negative-change {
    color: #F44336;
}

/* Dashboard Rows and Widgets */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.widget {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: 100%;
}

.widget h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.full-width {
    grid-column: 1 / -1;
}

/* Time Range Selector */
.time-range-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.time-range {
    padding: 5px 10px;
    font-size: 14px;
}

.time-range.active {
    background-color: #2196F3;
    color: white;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #777;
}

.loading-indicator .k-icon {
    margin-right: 10px;
}

/* Error Message */
.error-message {
    padding: 15px;
    background-color: #FFEBEE;
    color: #D32F2F;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

/* Transaction Detail View Styles */
.transaction-detail-container {
    padding: 15px;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.transaction-id {
    font-size: 14px;
    color: #777;
}

.transaction-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: baseline;
}

.info-label {
    font-weight: bold;
    width: 120px;
    color: #555;
}

.info-value {
    flex: 1;
}

.transaction-notes {
    margin-top: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.notes-content {
    white-space: pre-wrap;
    padding: 10px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    min-height: 60px;
}

.transaction-metadata {
    margin-top: 20px;
    font-size: 0.9em;
    color: #777;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
}

.split-bar-container {
    margin-top: 5px;
    width: 100%;
}

.split-bar {
    height: 20px;
    width: 100%;
    display: flex;
    border-radius: 3px;
    overflow: hidden;
}

.interest-portion {
    height: 100%;
    background-color: #4caf50;
}

.principal-portion {
    height: 100%;
    background-color: #2196f3;
}

.split-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    margin-top: 3px;
}

.repayment-details {
    grid-column: span 2;
}

.repayment-visualization {
    margin-top: 10px;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* App Layout */
#app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
#app-header {
    background-color: #57853E;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.94);
    padding: 6px 10px;
    border-radius: 10px;
}

.brand-logo-horizontal {
    display: block;
    max-height: 56px;
    width: auto;
    border-radius: 4px;
}

/* Header Menu Styles */
#main-menu.k-menu-horizontal {
    flex: 1;
    margin: 0 20px;
    background-color: transparent;
    border: none;
}

#main-menu.k-menu-horizontal .k-item {
    border: none;
}

#main-menu.k-menu-horizontal .k-link {
    color: white;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

#main-menu.k-menu-horizontal .k-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#main-menu.k-menu-horizontal .k-item.active .k-link {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#current-user {
    font-weight: 500;
}


/* Main Container */
#app-container {
    display: flex;
    flex: 1;
    margin: 0 auto;
    width: 100%;
    padding: .5rem;
}

/* Navigation Styles */

#main-menu {
    list-style: none;
}

#main-menu li {
    padding: 0.5rem 0;
}

#main-menu li a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

#main-menu li a:hover {
    background-color: #f0f0f0;
    color: #2c3e50;
}

#main-menu li.active a {
    background-color: #2c3e50;
    color: white;
    border-radius: 0 4px 4px 0;
}

/* Content Area */
#app-content {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    overflow-y: auto;
}

/* Footer Styles */
#app-footer {
    background-color: #57853E;
    color: #F4F8F1;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.94);
    padding: 2px;
}

.footer-branding p {
    margin: 0;
}

/* Responsive Design - Media Queries */

/* Extra Large Devices (large desktops, 1200px and below) */
@media (max-width: 1200px) {
    .header-container, #app-container, .footer-container {
        max-width: 1140px;
    }
    
    .dashboard-row {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

/* Large Devices (desktops, 992px and below) */
@media (max-width: 992px) {
    .header-container, #app-container, .footer-container {
        max-width: 960px;
    }
    
    .dashboard-row {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .financial-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium Devices (tablets, 768px and below) */
@media (max-width: 768px) {
    .header-container, #app-container, .footer-container {
        max-width: 720px;
    }
    
    /* Navigation adjustments */
    #app-container {
        flex-direction: column;
    }
    
    #main-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #main-menu li {
        padding: 0.25rem;
    }
    
    #main-menu li a {
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }
    
    #main-menu li.active a {
        border-radius: 4px;
    }
    
    /* Dashboard adjustments */
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    
    .financial-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Chart adjustments */
    .k-chart {
        height: 300px !important;
    }
    
    /* Form adjustments */
    .k-form-field {
        flex-direction: column;
    }
    
    .k-form-field > span:first-child {
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    .k-form-field > span:last-child {
        width: 100%;
    }
}

/* Small Devices (phones, 576px and below) */
@media (max-width: 576px) {
    .header-container, #app-container, .footer-container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .brand-logo-horizontal {
        max-height: 44px;
    }
    
    .header-container {
        flex-direction: column;
        padding: 10px 0;
    }
    
    #main-menu.k-menu-horizontal {
        margin: 10px 0;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #main-menu.k-menu-horizontal .k-item {
        margin: 5px 0;
    }
    
    /* User menu adjustments */
    .user-menu {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    /* Dashboard adjustments */
    .financial-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .time-range-selector {
        flex-wrap: wrap;
    }
    
    /* Transaction view adjustments */
    .filter-panel {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Chart toggle adjustments */
    .chart-toggle .k-button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .chart-toggle .k-button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Grid adjustments */
    .k-grid {
        font-size: 12px;
    }
    
    .k-grid-header th {
        white-space: normal;
        padding: 4px;
    }
    
    .k-grid td {
        padding: 4px;
    }
    
    /* Make grids horizontally scrollable on small screens */
    .k-grid-content {
        overflow-x: auto;
    }
    
    /* Modal dialog adjustments */
    .k-dialog {
        width: 95% !important;
        max-width: 95% !important;
    }
    
    .k-dialog .k-dialog-titlebar {
        padding: 8px 16px;
    }
    
    .k-dialog .k-dialog-buttongroup {
        flex-direction: column;
    }
    
    .k-dialog .k-dialog-buttongroup .k-button {
        margin: 4px 0;
        width: 100%;
    }
    
}

/* View Styles */
.dashboard-view,
.companies-view,
.investors-view,
.accounts-view,
.transactions-view,
.balances-view {
    margin-bottom: 2rem;
    width: 100%;
    height: 100%;
}

/* Content loaded state */
#app-content.content-loaded {
    display: flex;
    flex-direction: column;
}

#view-container.view-loaded {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: auto;
}

h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

/* Dashboard Widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.widget {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

/* Form Controls */
.toolbar,
.date-range-selector{
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

label {
    font-weight: 500;
}

select,
input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

/* Grid Styles */
.k-grid {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.k-grid th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

/* Button Styles */
.k-button {
    margin-right: 0.5rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
    
    .toolbar,
    .date-range-selector{
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Legacy styles for backward compatibility */
.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.section { margin: 24px 0; }

/* Loading Indicators */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

.loading-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-content .k-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.loading-message {
    font-size: 1.2rem;
    color: #333;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.loading-indicator .k-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Notification Styles */
.notification-success,
.notification-error,
.notification-warning,
.notification-info {
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: flex-start;
}

.notification-success {
    background-color: #2e7d32; /* Darker green background */
    border-left: 4px solid #1b5e20; /* Even darker green border */
    color: #ffffff; /* White text for high contrast */
}

.notification-error {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    color: #d32f2f; /* Darker red text for better contrast */
}

.notification-warning {
    background-color: #fff8e1;
    border-left: 4px solid #ff9800;
}

.notification-info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.notification-success .k-icon,
.notification-error .k-icon,
.notification-warning .k-icon,
.notification-info .k-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.notification-success .k-icon {
    color: #ffffff; /* White icon for dark background */
}

.notification-error .k-icon {
    color: #d32f2f; /* Darker red icon */
}

.notification-warning .k-icon {
    color: #ff9800;
}

.notification-info .k-icon {
    color: #2196f3;
}

.notification-success h4,
.notification-error h4,
.notification-warning h4,
.notification-info h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.2;
}

.notification-success h4 {
    color: #ffffff; /* White text for high contrast */
}

.notification-error h4 {
    color: #d32f2f; /* Darker red for headings */
    font-weight: 600; /* Make the heading more prominent */
}

.notification-success p,
.notification-error p,
.notification-warning p,
.notification-info p {
    margin: 0;
    font-size: 0.9rem;
}

.notification-success p {
    color: #ffffff; /* White paragraph text for high contrast */
}

.notification-error p {
    color: #7f0000; /* Even darker text for paragraph content */
    font-weight: 500; /* Slightly bolder text */
}
