/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #F0F2F5;
    color: #333;
}

/* Header - Updated with new color */
.navbar {
    background-color: #30475e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Logo styling - New WB curved square logo */
#logo-container {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    background-color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #30475e;
    font-size: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.navbar h1 {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    color: white;
    margin-right: auto; /* Push the following items to the right */
}


/* Transaction Entry & Summary Containers */
.transaction-entry-container,
.summary-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px;
    padding: 0 0 20px 0;
}

/* Unified section header styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f1f4;
    background-color: #ffffff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

/* Primary button styling - Unified for all main buttons */
.primary-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #30475e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    height: 38px;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: #243848;
}

/* Submit button consistency */
.submit-btn {
    padding: 10px 24px;
    font-size: 16px;
    min-width: 180px;
}

/* Empty state styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px dashed #d1d5db;
    margin: 15px;
}

.empty-state-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 500;
    color: #4b5563;
}

.empty-state p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Transaction Table - IMPROVED SIZING */
.transaction-table-container {
    overflow-x: auto;
    margin: 15px;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    position: relative;
    padding: 10px;
}

.transaction-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
    white-space: nowrap;
    table-layout: fixed;
}

/* Table header styling - SLEEK MODERN DESIGN */
.transaction-table thead,
.review-table thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 38px;
}

/* Ensure table headers have correct styling and alignment */
.transaction-table th,
.review-table th {
    padding: 8px 16px;
    text-align: left;
    font-weight: 500;
    color: #64748b;
    font-size: 13px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Table row styling - SLEEKER HEIGHT */
.transaction-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    height: 48px; /* Reduced for sleeker look */
}

.transaction-table td {
    padding: 6px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* Form inputs inside table cells - SLEEKER DESIGN */
.transaction-table .form-input,
.transaction-table select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    height: 36px; /* Reduced height for sleeker look */
    box-sizing: border-box;
    margin: 0;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

/* Improved focus state */
.transaction-table .form-input:focus,
.transaction-table select:focus {
    border: 1px solid #30475e;
    outline: none;
    box-shadow: 0 0 0 2px rgba(48, 71, 94, 0.1);
}

/* Alignment fixes for numeric fields */
.transaction-table .qty,
.transaction-table .price,
.transaction-table .total,
.transaction-table .gst,
.transaction-table .brokerage,
.transaction-table .misc,
.transaction-table .total-charges {
    text-align: right;
}

/* Numeric formatting */
input[type="number"] {
    text-align: right;
    padding-right: 15px;
    /* Remove spinner buttons from number inputs */
    -moz-appearance: textfield;
    appearance: textfield; /* Standard property */
}

/* Remove spinner buttons for Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none; /* Standard property */
    margin: 0;
}


/* Remove spinner buttons for Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: white;
    padding-right: 30px; /* Space for dropdown arrow */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%234b5563" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Cell width definitions - ADJUSTED FOR BETTER VISIBILITY */
.account-id-dropdown { width: 170px; }
.account-name { width: 170px; }
.account-display { width: 170px; }
.ticker { width: 130px; } /* Increased ticker width */
.security-name { width: 300px; } /* Expanded to fit 60 characters */
.trade-date { width: 130px; }
.qty { width: 140px; } /* Further increased for better visibility */
.price { width: 150px; }
.total { width: 180px; } /* Expanded total field */
.gst, .brokerage, .misc { width: 100px; }
.total-charges { width: 140px; } /* Made consistent with numeric fields */
.is-ipo, .is-bonus, .is-split, .type { width: 100px; }

/* Fix action buttons to ensure they're properly contained */
.action-buttons {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    justify-content: center;
    width: 110px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 16px;
}

.add-btn {
    background-color: #10B981;
}

.copy-btn {
    background-color: #3B82F6;
}

.remove-btn {
    background-color: #EF4444;
}

/* Transaction Summary */
.summary-section {
    margin-top: 30px;
    overflow-x: auto; /* Allow horizontal scrolling for wide content */
}

.title-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-group h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #374151;
}

.export-icon {
    font-size: 16px;
}

.summary-stats {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
    padding: 0 15px;
}

.stat-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px 20px;
    min-width: 160px;
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.buy-value {
    color: #10B981;
}

.sell-value {
    color: #EF4444;
}

/* Transaction Table */
.transaction-review {
    overflow-x: auto;
    padding: 0 15px;
    margin-bottom: 20px;
}

.review-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.review-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    white-space: nowrap;
    font-size: 14px;
}

/* Zebra striping for summary table */
.review-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.review-table tbody tr:hover {
    background-color: #f0f2f5;
}

/* Submit Button */
.button-group {
    display: flex;
    justify-content: flex-end;
    margin: 20px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeIn 0.3s forwards;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 300px;
}

.success {
    background-color: #10B981;
}

.error {
    background-color: #EF4444;
}

.info {
    background-color: #3B82F6;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Coming Soon Pages */
.coming-soon {
    text-align: center;
    padding: 50px;
    color: #6b7280;
    font-size: 18px;
}

/* Ticker dropdown styling */
.ticker-dropdown {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 300px;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f0f2f5;
}

.dropdown-item.loading, 
.dropdown-item.error {
    font-style: italic;
    color: #6b7280;
    padding: 12px 16px;
}

/* Focus styles for better accessibility */
.form-input:focus, 
select:focus,
.tab-button:focus,
.action-btn:focus,
.primary-btn:focus {
    outline: 2px solid #30475e;
    outline-offset: 1px;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.pagination-btn:hover {
    background-color: #f9fafb;
}

.pagination-btn.active {
    background-color: #30475e;
    color: white;
    border-color: #30475e;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .summary-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-header .primary-btn {
        align-self: flex-end;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Make the table header sticky on mobile too */
    .transaction-review {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Remove the horizontal scrolling navigation */
.scroll-navigation {
    display: none !important;
}

.scroll-btn {
    background-color: #f0f2f5;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    color: #4b5563;
    font-weight: bold;
}

.scroll-track {
    flex-grow: 1;
    height: 8px;
    background-color: #f0f2f5;
    margin: 0 12px;
    border-radius: 4px;
    position: relative;
}

.scroll-thumb {
    position: absolute;
    height: 8px;
    width: 60px;
    background-color: #30475e;
    border-radius: 4px;
    top: 0;
    left: 0;
}

/* Error styling */
.form-input.error, 
select.error {
    border: 2px solid #EF4444;
    background-color: #FEF2F2;
}

.numeric-error-icon, 
.date-error-icon {
    font-size: 16px;
}

/* Status indicator */
.status-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
}

.status-indicator.valid {
    background-color: #D1FAE5;
    color: #10B981;
}

/* Make sure the transactionRows tbody appears correctly */
#transactionRows {
    display: table-row-group;
}

#transactionRows[style*="none"] {
    display: none !important;
}
.user-info {
    display: flex;
    align-items: center;
    color: white;
    font-size: 14px;
}

.welcome-text {
    margin-right: 15px;
}

.user-welcome {
    color: white;
    font-size: 15px;
    margin-right: 15px;
}

#username-display {
    font-weight: 500;
}

.logout-btn {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.logout-btn i {
    margin-right: 5px;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 15px;
    }
    
    .user-welcome {
        display: none; /* Hide on mobile */
    }
    
    .logout-btn {
        padding: 6px 8px;
    }
}


