/**
 * Component-specific styles for FA Calculator
 * Buttons, progress bars, tables, modals, etc.
 */

/* Button styles */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.btn-primary:disabled {
    background: #cbd5e0 !important;
    color: #a0aec0 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

#download-csv {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white !important;
    border: none;
}

#download-csv:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
}

.btn i {
    margin-right: 8px;
}

.btn-remove {
    background: #fed7d7;
    color: #742a2a;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #feb2b2;
}

.btn-clear-sale {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 8px;
    transition: all 0.2s ease;
    vertical-align: middle;
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-sale:hover {
    background: #e53e3e;
    transform: translateY(-50%) scale(1.1);
}

.btn-recalculate {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-recalculate:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 20px 0;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

/* Status messages */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
}

.status-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.status-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.status-info {
    background: #ebf8ff;
    color: #2a4365;
    border: 1px solid #90cdf4;
}

.status-warning {
    background: #fffbf0;
    color: #744210;
    border: 1px solid #f6e05e;
}

/* Validation messages */
.validation-message {
    margin-top: 15px;
    padding: 12px 16px;
    background: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 8px;
    color: #742a2a;
    font-size: 0.9rem;
    line-height: 1.4;
}

.validation-message ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.validation-message li {
    margin-bottom: 4px;
}

.validation-message .reason-title {
    font-weight: 600;
    color: #9b2c2c;
}

/* Table styles */
.table-container {
    overflow-x: hidden;
    overflow-y: visible;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

/* Transaction table optimizations */
.main-card table {
    width: 100%;
    table-layout: fixed;
    max-width: 100%;
}

.main-card table th {
    padding: 6px 4px;
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.85rem;
    line-height: 1.2;
    vertical-align: top;
}

.main-card table td {
    padding: 6px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

/* Fixed column widths */
.main-card table th:nth-child(1), .main-card table td:nth-child(1) { width: 8%; }
.main-card table th:nth-child(2), .main-card table td:nth-child(2) { width: 14%; min-width: 140px; }
.main-card table th:nth-child(3), .main-card table td:nth-child(3) { width: 8%; }
.main-card table th:nth-child(4), .main-card table td:nth-child(4) { width: 14%; min-width: 120px; } /* Vest price */
.main-card table th:nth-child(5), .main-card table td:nth-child(5) { width: 14%; min-width: 160px; } /* Sell date */
.main-card table th:nth-child(6), .main-card table td:nth-child(6) { width: 8%; }
.main-card table th:nth-child(7), .main-card table td:nth-child(7) { width: 15%; min-width: 130px; } /* Total Sell Price INR - much wider */
.main-card table th:nth-child(8), .main-card table td:nth-child(8) { width: 12%; min-width: 100px; } /* Dividend Income INR - much smaller */
.main-card table th:nth-child(9), .main-card table td:nth-child(9) { width: 10%; min-width: 80px; }

.table-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.table-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Validation states - matching original behavior */
.required-field { 
    border: 2px solid #e53e3e !important; 
    background-color: #fed7d7 !important;
    box-shadow: 0 0 0 1px #e53e3e !important;
}

.required-field.filled { 
    border: 2px solid #38a169 !important; 
    background-color: #f0fff4 !important;
    box-shadow: 0 0 0 1px #38a169 !important;
}

/* Additional validation states for compatibility */
.table-input.invalid {
    border: 2px solid #e53e3e !important; 
    background-color: #fed7d7 !important;
    box-shadow: 0 0 0 1px #e53e3e !important;
}

.table-input.valid {
    border: 2px solid #38a169 !important; 
    background-color: #f0fff4 !important;
    box-shadow: 0 0 0 1px #38a169 !important;
}

/* Focus states for validation */
.table-input.invalid:focus,
.required-field:focus {
    border: 2px solid #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2) !important;
}

.table-input.valid:focus,
.required-field.filled:focus {
    border: 2px solid #38a169 !important;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.2) !important;
}

/* Date input specific styling */
input[type="date"].table-input {
    min-width: 130px;
    width: 100%;
    font-family: inherit;
    font-size: 14px;
}

/* Ensure date columns have adequate space */
.main-card table td:nth-child(2) input[type="date"],
.main-card table td:nth-child(5) input[type="date"] {
    min-width: 130px;
}

.sell-date-with-clear {
    width: 100%;
    min-width: 170px;
    padding: 4px 8px 4px 20px !important; /* More right padding to prevent overlap */
}

/* Action column styling */
.main-card table th:nth-child(9),
.main-card table td:nth-child(9) {
    text-align: center;
    padding: 6px 8px;
}

.main-card table td:nth-child(9) button {
    width: 100%;
    min-width: 70px;
    padding: 6px 8px;
    font-size: 0.85rem;
}

.editable-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 32px; /* Ensure minimum height for proper icon spacing */
    flex-wrap: nowrap; /* Prevent wrapping */
}

/* Ensure field display doesn't take up all space when refresh icon is present */
.editable-field .field-display {
    flex: 1;
    min-width: 0; /* Allow shrinking */
    margin-right: 4px; /* Add small gap before refresh icon */
}

.field-display {
    display: block;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f7fafc;
    color: #718096;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field-display:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Style for auto-fetched and status text within field displays */
.field-display small {
    font-size: 0.6rem !important; /* Much smaller than main text */
    font-weight: normal !important;
    opacity: 0.8;
    margin-left: 2px;
}

/* Specific styling for auto-fetched status */
.field-display small[style*="color: #667eea"],
.field-display small[style*="color: #28a745"] {
    font-size: 0.55rem !important; /* Even smaller for status text */
    font-weight: 500 !important;
    white-space: nowrap;
}

.field-input {
    display: none;
}

/* Table actions */
.table-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.table-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Dividend column disabled state */
.dividend-column-disabled {
    opacity: 0.4 !important;
    background-color: #f1f5f9 !important;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(148, 163, 184, 0.1) 10px,
        rgba(148, 163, 184, 0.1) 20px
    ) !important;
    position: relative !important;
}

.dividend-column-disabled::after {
    content: "DISABLED";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 0.7rem;
    font-weight: bold;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.dividend-column-disabled input,
.dividend-column-disabled .field-display {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    background-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    border: 2px dashed #cbd5e0 !important;
    pointer-events: none !important;
}

.dividend-column-disabled input:disabled {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
}

.dividend-column-disabled .field-display:hover {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e0 !important;
    cursor: not-allowed !important;
}

/* Make the table header for dividend column also very obvious when disabled */
th.dividend-column-disabled {
    background-color: #f1f5f9 !important;
    color: #94a3b8 !important;
    opacity: 0.6 !important;
    font-style: italic !important;
}

/* Refresh data icon styling */
.refresh-data-icon {
    margin-left: 8px;
    cursor: pointer;
    color: #2d3748; /* Much darker color */
    font-size: 0.8rem;
    opacity: 0.9; /* Higher opacity for better visibility */
    transition: all 0.2s ease;
    vertical-align: middle;
    flex-shrink: 0; /* Prevent icon from shrinking */
    display: inline-block;
    min-width: 12px; /* Reserve minimum space for icon */
}

.refresh-data-icon:hover {
    color: #007bff;
    opacity: 1;
    transform: scale(1.1);
}

.refresh-data-icon:active {
    transform: scale(0.95);
}

/* Hide refresh icons when dividend calculation is disabled */
.dividend-column-disabled .refresh-data-icon {
    display: none;
}

/* Fetching state styling */
.fetching-data {
    background-color: #fff3cd !important;
    border-color: #ffeaa7 !important;
    color: #856404 !important;
}

/* Table disabled during calculation */
.table-disabled-calculation {
    position: relative;
    opacity: 0.6;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.table-disabled-calculation::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    border-radius: 8px;
}

.table-disabled-calculation::before {
    content: "🔒 TABLE LOCKED - CALCULATION IN PROGRESS";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 123, 255, 0.95);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    z-index: 11;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    text-align: center;
    white-space: nowrap;
    border: 2px solid #0056b3;
}

/* Disabled input fields during calculation */
.table-disabled-calculation input,
.table-disabled-calculation button,
.table-disabled-calculation .field-display {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    pointer-events: none !important;
    user-select: none !important;
}

.table-disabled-calculation input:disabled {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
}

/* Block all interactions on disabled table */
.table-disabled-calculation * {
    pointer-events: none !important;
}

/* Button help icons */
.btn-help-icon {
    margin-left: 8px;
    font-size: 0.8rem;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-help-icon:hover {
    opacity: 1;
    color: #ffffff !important;
}

.btn-primary .btn-help-icon {
    color: rgba(255, 255, 255, 0.8);
}

/* Help content styling */
.help-content {
    line-height: 1.6;
    color: #333;
}

.help-content h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.help-content h4 {
    color: #34495e;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
}

.help-content p {
    margin-bottom: 15px;
}

.help-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.help-content li {
    margin-bottom: 8px;
}

.help-example {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.help-example p {
    margin-bottom: 10px;
    font-weight: 600;
}

.help-example ul {
    margin-bottom: 10px;
}

.help-example li {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background-color: #ffffff;
    padding: 4px 8px;
    border-radius: 3px;
    margin-bottom: 4px;
}

.help-example em {
    color: #dc3545;
    font-weight: bold;
}

/* Disabled action buttons during calculation */
.btn-add-row:disabled,
.btn-combine-lots:disabled,
.btn-clear-all:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

/* Disclaimer Modal Styles */
.disclaimer-modal {
    display: block;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.disclaimer-modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: disclaimerSlideIn 0.3s ease-out;
}

@keyframes disclaimerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.disclaimer-header {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.disclaimer-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.disclaimer-body {
    padding: 30px;
    line-height: 1.6;
    color: #333;
}

.disclaimer-warning {
    background: #fed7d7;
    border: 2px solid #fc8181;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.disclaimer-risk {
    background: #fef5e7;
    border: 2px solid #f6ad55;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.disclaimer-body h3 {
    color: #2d3748;
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.disclaimer-body ul {
    margin: 10px 0 20px 20px;
}

.disclaimer-body li {
    margin: 8px 0;
}

.disclaimer-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 0 0 12px 12px;
}

.disclaimer-checkbox {
    margin-bottom: 20px;
}

.disclaimer-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    color: #2d3748;
}

.disclaimer-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.disclaimer-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-decline {
    background: #718096;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-decline:hover {
    background: #4a5568;
    transform: translateY(-1px);
}

.btn-accept {
    background: #48bb78;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-accept:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-1px);
}

.btn-accept:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Results table */
.results-section {
    margin-top: 30px;
    display: none;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    transition: all 0.3s ease;
}

.results-section.outdated {
    opacity: 0.5;
    pointer-events: none;
}

.results-outdated-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    z-index: 100;
}

.results-outdated-message {
    text-align: center;
    padding: 30px;
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.results-outdated-message h3 {
    color: #856404;
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.results-outdated-message p {
    color: #856404;
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.results-table-container {
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: visible;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: fixed;
    overflow: visible;
}

.results-table th,
.results-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 0.85rem;
}

/* Results table column widths */
.results-table th:nth-child(1), .results-table td:nth-child(1) { width: 8%; }
.results-table th:nth-child(2), .results-table td:nth-child(2) { width: 6%; }
.results-table th:nth-child(3), .results-table td:nth-child(3) { width: 12%; }
.results-table th:nth-child(4), .results-table td:nth-child(4) { width: 12%; }
.results-table th:nth-child(5), .results-table td:nth-child(5) { width: 6%; }
.results-table th:nth-child(6), .results-table td:nth-child(6) { width: 8%; }
.results-table th:nth-child(7), .results-table td:nth-child(7) { width: 8%; }
.results-table th:nth-child(8), .results-table td:nth-child(8) { width: 10%; }
.results-table th:nth-child(9), .results-table td:nth-child(9) { width: 10%; }
.results-table th:nth-child(10), .results-table td:nth-child(10) { width: 8%; }
.results-table th:nth-child(11), .results-table td:nth-child(11) { width: 6%; }
.results-table th:nth-child(12), .results-table td:nth-child(12) { width: 6%; }

/* Right align numeric columns */
.results-table th:nth-child(2), .results-table td:nth-child(2),
.results-table th:nth-child(8), .results-table td:nth-child(8),
.results-table th:nth-child(9), .results-table td:nth-child(9),
.results-table th:nth-child(10), .results-table td:nth-child(10),
.results-table th:nth-child(11), .results-table td:nth-child(11),
.results-table th:nth-child(12), .results-table td:nth-child(12) {
    text-align: right;
}

.results-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.results-table tr:hover {
    background: #f7fafc;
}

/* Modal styles */
.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.4);
    backdrop-filter: blur(5px);
}

/* Button help modal should appear above other modals */
#buttonHelpModal {
    z-index: 1100 !important;
}

/* Enhanced Log Modal Styles */
.log-modal-content {
    max-width: 900px;
    max-height: 85vh;
    margin: 2% auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.log-modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.log-modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.log-modal-close:hover {
    color: white;
}

.log-modal-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.log-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-toolbar-label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 5px;
}

.log-filter-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 14px;
    min-width: 150px;
    transition: border-color 0.2s ease;
}

.log-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.log-toolbar-btn {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.log-toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.log-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.log-btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.log-btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.log-btn-secondary:hover {
    background: #5a6268;
}

.log-stats-bar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.log-stats-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    background: white;
    border: 1px solid #e9ecef;
}

.log-stats-error {
    color: #dc3545;
    border-color: #f5c6cb;
    background: #f8d7da;
}

.log-stats-warning {
    color: #856404;
    border-color: #ffeaa7;
    background: #fff3cd;
}

.log-stats-info {
    color: #0c5460;
    border-color: #b8daff;
    background: #d1ecf1;
}

.log-content-container {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    background: #f8f9fa;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
}

.log-empty-state {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.log-empty-icon {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
}

.log-empty-state p {
    font-size: 16px;
    margin: 0 0 5px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.log-empty-state small {
    font-size: 14px;
    color: #adb5bd;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.log-modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 15px 30px;
    text-align: right;
    border-radius: 0 0 12px 12px;
}

/* Log entry styling */
.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry-error {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-left: 4px solid #dc3545;
    margin: 4px 0;
    border-radius: 4px;
}

.log-entry-warning {
    background: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border-left: 4px solid #ffc107;
    margin: 4px 0;
    border-radius: 4px;
}

.log-entry-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 8px 12px;
    border-left: 4px solid #17a2b8;
    margin: 4px 0;
    border-radius: 4px;
}

.log-entry-skipped {
    background: #e2e3e5;
    color: #383d41;
    padding: 8px 12px;
    border-left: 4px solid #6c757d;
    margin: 4px 0;
    border-radius: 4px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: none;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    background: #007bff;
    border: 1px solid #0056b3;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
    line-height: 1;
}

.close:hover,
.close:focus {
    background: #0056b3;
    border-color: #004085;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Save/Load modal styles */
.save-options, .load-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* Option row layout */
.save-option-row, .load-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.save-option-row:hover, .load-option-row:hover {
    border-color: #cbd5e0;
    background-color: #edf2f7;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Option content */
.save-option-content, .load-option-content {
    flex: 1;
    margin-right: 20px;
}

.save-option-header, .load-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.save-option-header i, .load-option-header i {
    font-size: 18px;
    color: #4a5568;
    width: 20px;
    text-align: center;
}

.save-option-title, .load-option-title {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
}

.save-option-description, .load-option-description {
    margin: 0;
    color: #718096;
    font-size: 14px;
    line-height: 1.4;
}

/* Option action */
.save-option-action, .load-option-action {
    flex-shrink: 0;
}

.save-option-action .btn, .load-option-action .btn {
    min-width: 120px;
    padding: 10px 16px;
    font-weight: 500;
}

/* Template list container */
.template-list-container {
    margin-top: 15px;
    padding: 15px;
    background-color: #f0f4f8;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
}

.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.template-info h4 {
    margin: 0 0 5px 0;
    color: #2d3748;
    font-size: 16px;
}

.template-info p {
    margin: 0 0 5px 0;
    color: #4a5568;
    font-size: 14px;
}

.template-info small {
    color: #718096;
    font-size: 12px;
}

/* Legacy styles for backward compatibility */
.save-options .btn {
    min-width: 140px;
    padding: 12px 20px;
}

.template-list {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.template-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.template-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-1px);
}

.template-item h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1em;
}

.template-item p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.load-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.load-section {
    padding: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
}

.load-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.load-section p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9em;
}

.file-load-buttons {
    display: flex;
    gap: 10px;
}

.load-divider {
    text-align: center;
    position: relative;
    margin: 10px 0;
}

.load-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.load-divider span {
    background: white;
    padding: 0 15px;
    color: #666;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* Disclaimer Strip */
.disclaimer-strip {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 8px 0;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #991b1b;
}

.disclaimer-content {
    white-space: nowrap;
    animation: scroll-left 30s linear infinite;
    display: inline-block;
}

.disclaimer-text {
    font-size: 14px;
    font-weight: 500;
    padding: 0 50px;
    display: inline-block;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Pause animation on hover */
.disclaimer-strip:hover .disclaimer-content {
    animation-play-state: paused;
}

/* Load Data Options Modal */
.load-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.load-option {
    text-align: center;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.load-option:hover {
    border-color: #cbd5e0;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.load-option-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.load-option h3 {
    margin: 10px 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.load-option p {
    margin: 0 0 15px 0;
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.4;
}

.load-option .btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem;
}

/* Specific button colors for load data modal */
.load-option .btn-cancel {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.load-option .btn-cancel:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}
