/**
 * Reconciliation Tool Frontend Styles
 */

.reconcile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.reconcile-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.reconcile-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.reconcile-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Form Styles */
.reconcile-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 10px;
}

.file-upload-group {
    margin-bottom: 20px;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.file-label.dragover {
    border-color: #667eea;
    background-color: #f0f4ff;
}

.label-text {
    font-weight: 600;
    color: #333;
    min-width: 150px;
}

.file-input-wrapper {
    position: relative;
    flex: 1;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-text {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover .file-input-text {
    background: #e9ecef;
    border-color: #adb5bd;
}

.file-info {
    font-size: 0.9em;
    color: #666;
    margin-left: auto;
}

.form-options {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.option-label span:first-child {
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

.option-label select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    min-width: 150px;
}

.custom-date-inputs {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.custom-date-inputs label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 600;
    color: #333;
}

.custom-date-inputs input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.button-secondary {
    background: #6c757d;
    color: white;
}

.button-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.button-large {
    padding: 16px 32px;
    font-size: 1.1em;
}

.button-spinner {
    display: inline-flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Status Styles */
.reconcile-status {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.status-header h3 {
    margin: 0;
    color: #333;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.running {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #666;
}

.status-message {
    text-align: center;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
}

.status-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9em;
    color: #666;
}

/* Results Styles */
.reconcile-results {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e5e9;
}

.results-header h3 {
    margin: 0;
    color: #333;
}

.summary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.metric-value {
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs Styles */
.results-tabs {
    margin-bottom: 30px;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #333;
    background: #f8f9fa;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Table Styles */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 250px;
}

.table-container {
    overflow-x: auto;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
}

.reconcile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.reconcile-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
}

.reconcile-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: top;
}

.reconcile-table tbody tr:hover {
    background: #f8f9fa;
}

.amount {
    font-family: monospace;
    font-weight: 600;
}

.amount.positive {
    color: #28a745;
}

.amount.negative {
    color: #dc3545;
}

/* Download Section */
.download-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-top: 30px;
}

.download-section h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.download-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.download-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Error Styles */
.reconcile-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.error-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.error-header h3 {
    margin: 0;
}

.error-message {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .reconcile-container {
        padding: 15px;
    }
    
    .reconcile-header h2 {
        font-size: 2em;
    }
    
    .reconcile-form,
    .reconcile-status,
    .reconcile-results {
        padding: 20px;
    }
    
    .file-label {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .label-text {
        min-width: auto;
        text-align: center;
    }
    
    .file-info {
        margin-left: 0;
        text-align: center;
    }
    
    .custom-date-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-metrics {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .metric-value {
        font-size: 1.5em;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .search-box input {
        min-width: auto;
        width: 100%;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .reconcile-header h2 {
        font-size: 1.8em;
    }
    
    .reconcile-form,
    .reconcile-status,
    .reconcile-results {
        padding: 15px;
    }
    
    .button-large {
        padding: 14px 24px;
        font-size: 1em;
    }
    
    .summary-metrics {
        grid-template-columns: 1fr;
    }
}
