/* PropStitch - CSV Enrichment Styles */

:root {
    --primary-blue: #38bdf8;
    --secondary-green: #059669;
    --accent-red: #DC2626;
    --success-green: #16A34A;
    --background-dark: #18181b;
    --background-dark-alt: #23272f;
    --text-light: #fff;
    --text-muted: #b6c2d1;
    --card-bg: #23272f;
    --border-dark: #222;
    --property-gold: #F59E0B;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(120deg, var(--background-dark) 0%, #1e293b 100%);
    color: var(--text-light);
    line-height: 1.6;
}

/* --- COMPREHENSIVE DARK THEME OVERRIDES --- */

/* Card Overrides - Ensure dark backgrounds */
.card,
.card-body,
.card-header,
.card-footer {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
    border-color: var(--border-dark) !important;
}

.card-header {
    background: linear-gradient(135deg, #2a2f3a 0%, #1e293b 100%) !important;
    border-bottom-color: var(--border-dark) !important;
}

/* Form Controls - Dark theme */
.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
    background: #1e293b !important;
    border-color: #374151 !important;
    color: var(--text-light) !important;
}

.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25) !important;
}

/* 
 * DEFAULT TABLE STYLING - ELEGANT TABLES
 * 
 * All tables now automatically use modern styling with:
 * - Rounded corners and subtle shadows
 * - Hover effects with row lifting
 * - Centered content and bold headers
 * - Responsive design for mobile
 * - Dark theme compatibility
 * 
 * To use: Simply add class="table" to any table
 * For additional styling: Add table-hover, table-striped, etc.
 * 
 * Example:
 * <table class="table table-hover">
 *   <thead><tr><th>Header</th></tr></thead>
 *   <tbody><tr><td>Data</td></tr></tbody>
 * </table>
 */
.table,
.table-dark,
.table-striped {
    background: var(--card-bg) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.table th,
.table thead th {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    padding: 0.75rem !important;
    border-bottom: 2px solid var(--primary-blue) !important;
    position: relative !important;
    text-align: center !important;
}

.table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--border-dark);
}

.table td,
.table tbody tr {
    background: var(--background-dark-alt) !important;
    transition: all 0.2s ease-in-out !important;
    border-bottom: 1px solid var(--border-dark) !important;
    padding: 1rem 0.75rem !important;
    color: var(--text-light) !important;
    font-size: 0.9rem !important;
    border: none !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.table tbody tr:hover {
    background: #1e293b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.table tbody tr:nth-child(even) {
    background: #1a1f2e !important;
}

.table tbody tr:nth-child(even):hover {
    background: #1e293b !important;
}

.table tbody td:first-child {
    font-weight: 500 !important;
}

/* Modal Overrides */
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
    border-color: var(--border-dark) !important;
}

.modal-header {
    border-bottom-color: var(--border-dark) !important;
}

.modal-footer {
    border-top-color: var(--border-dark) !important;
}

/* Dropdown Overrides */
.dropdown-menu {
    background: #1e293b !important;
    border-color: var(--border-dark) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
    z-index: 1001 !important;
}

.dropdown-item {
    color: var(--text-light) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--primary-blue) !important;
    color: #fff !important;
}

.dropdown-divider {
    border-color: var(--border-dark) !important;
}

/* Alert Overrides */
.alert,
.alert-success,
.alert-warning,
.alert-danger,
.alert-info {
    background: #1e293b !important;
    color: var(--text-light) !important;
    border: 1px solid var(--border-dark) !important;
}

.alert-success {
    border-left: 4px solid var(--success-green) !important;
}

.alert-warning {
    border-left: 4px solid #facc15 !important;
}

.alert-danger {
    border-left: 4px solid var(--accent-red) !important;
}

.alert-info {
    border-left: 4px solid var(--primary-blue) !important;
}

/* Badge Overrides */
.badge {
    color: #fff !important;
}

.badge.bg-secondary {
    background: #6b7280 !important;
}

/* Button Overrides */
.btn-outline-secondary {
    color: var(--text-light) !important;
    border-color: #6b7280 !important;
}

.btn-outline-secondary:hover {
    background: #6b7280 !important;
    color: #fff !important;
}

/* List Group Overrides */
.list-group,
.list-group-item {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
    border-color: var(--border-dark) !important;
}

/* Accordion Overrides */
.accordion-item {
    background: var(--card-bg) !important;
    border-color: var(--border-dark) !important;
}

.accordion-button {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
    border-color: var(--border-dark) !important;
}

.accordion-button:not(.collapsed) {
    background: #1e293b !important;
    color: var(--text-light) !important;
}

.accordion-body {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
}

/* Progress Overrides */
.progress {
    background: #1e293b !important;
}

.nav-tabs .nav-link {
    color: var(--text-light) !important;
    background: var(--card-bg) !important;
}

.nav-tabs .nav-link.active {
    background: var(--primary-blue) !important;
    color: #fff !important;
    border-color: var(--primary-blue) !important;
}

/* Pagination Overrides */
.pagination .page-link {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
    border-color: var(--border-dark) !important;
}

.pagination .page-link:hover {
    background: var(--primary-blue) !important;
    color: #fff !important;
}

.pagination .page-item.active .page-link {
    background: var(--primary-blue) !important;
    color: #fff !important;
    border-color: var(--primary-blue) !important;
}

/* Text Color Overrides */
.text-muted {
    color: var(--text-muted) !important;
}

.text-light {
    color: var(--text-light) !important;
}

.bg-light {
    background: var(--card-bg) !important;
}

.bg-white {
    background: var(--card-bg) !important;
}

.bg-dark-subtle {
    background: #1e293b !important;
}

.border {
    border-color: var(--border-dark) !important;
}

.border-light {
    border-color: var(--border-dark) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4) !important;
}

/* --- NAVIGATION --- */
.navbar-brand {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1.5px;
}

.navbar-brand .house-icon {
    color: var(--primary-blue);
    margin-right: 0.5rem;
}

/* --- HERO SECTIONS --- */
.hero-section, .hero-content {
    text-align: center;
    padding: 2rem 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- WORKFLOW STEPS --- */
.template-workflow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.workflow-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2f3a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    border: 2px solid var(--border-dark);
    transition: all 0.3s ease;
}

.workflow-step.active .workflow-icon {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-green));
    color: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.workflow-step.completed .workflow-icon {
    background: linear-gradient(135deg, var(--success-green), var(--secondary-green));
    color: #fff;
    border-color: var(--success-green);
}

.workflow-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.workflow-step.active + .workflow-arrow {
    color: var(--primary-blue);
}

/* --- CHAT INTERFACE --- */
.chat-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.chat-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.chat-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-right: 1rem;
}

.chat-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.chat-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 12px;
}

.bot-message {
    background: #1e293b;
    border-left: 4px solid var(--primary-blue);
}

.user-message {
    background: var(--primary-blue);
    color: #fff;
    margin-left: 2rem;
}

.message-content {
    line-height: 1.6;
}

.user-message .message-content {
    color: #fff;
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin-bottom: 0.25rem;
}

.chat-input-container {
    border-top: 1px solid var(--border-dark);
    padding-top: 1rem;
}

.chat-form {
    display: flex;
    gap: 1rem;
}

.chat-input {
    flex: 1;
    background: #1e293b;
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-light);
    resize: none;
}

.chat-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25);
}

.chat-send-btn {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-suggestions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.suggestion-btn {
    background: #1e293b;
    color: var(--text-light);
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.suggestion-btn:hover {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
    text-decoration: none;
}

/* --- UPLOAD CONTAINER --- */
.upload-container {
    border: 2px dashed var(--border-dark);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: #1e293b;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-container:hover, .upload-container.dragover {
    border-color: var(--primary-blue);
    background: rgba(56, 189, 248, 0.1);
}

.upload-container.file-selected {
    border-color: var(--success-green);
    background: rgba(22, 163, 74, 0.1);
}

.upload-container.file-selected .upload-text {
    color: var(--success-green);
}

.upload-container.file-selected .upload-subtext {
    color: var(--text-muted);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.file-input-wrapper {
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.file-input-label {
    background: var(--primary-blue);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
}

.file-input-label:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

/* --- PROCESS BUTTON --- */
.btn-process {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-green));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.btn-process:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4);
    color: #fff;
}

.btn-process:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- TEMPLATE GALLERY --- */
.template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.template-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.clickable-template {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-template::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(5, 150, 105, 0.1));
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clickable-template:hover::before {
    opacity: 1;
}

.template-action {
    margin-top: 1rem;
}

.template-action .btn {
    width: 100%;
}

.clickable-template:hover .template-action .btn {
    background: var(--primary-blue);
    color: #fff;
}

/* --- TYPING INDICATOR --- */
.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 1rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- PROGRESS SECTION --- */
.progress-section {
    margin: 2rem 0;
}

.progress-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 1rem;
}

.progress-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-green));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-stat {
    text-align: center;
}

.progress-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.progress-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* --- RESULTS SECTION --- */
.results-section {
    margin: 2rem 0;
}

.results-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.results-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--success-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.results-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.results-summary {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.summary-item {
    text-align: center;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- ALERTS --- */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: rgba(22, 163, 74, 0.1);
    border-left: 4px solid var(--success-green);
}

.alert-warning {
    background: rgba(250, 204, 21, 0.1);
    border-left: 4px solid #facc15;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    border-left: 4px solid var(--accent-red);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .upload-container {
        padding: 2rem 1rem;
    }
    
    .template-workflow {
        flex-direction: column;
        gap: 1rem;
    }
    
    .workflow-arrow {
        transform: rotate(90deg);
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- SPINNER --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #1e293b;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- FEATURE CARDS --- */
.feature-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-dark);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 1.5rem;
}

/* --- AVAILABLE COLUMNS --- */
.available-columns {
    background: #1e293b;
    border-radius: 12px;
    padding: 1rem;
}

.column-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-dark);
    transition: all 0.2s ease;
}

.column-item:hover {
    background: #2a2f3a;
    border-color: var(--primary-blue);
}

.column-name {
    font-weight: 600;
    color: var(--text-light);
}

/* --- FORM VALIDATION --- */
.form-select.is-valid {
    border-color: var(--success-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(22, 163, 74, 0.25) !important;
}

.form-select.is-invalid {
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25) !important;
}

/* --- TABLE RESPONSIVE --- */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

.table th {
    background: var(--primary-blue) !important;
    color: #fff !important;
    font-weight: 600;
    text-align: center;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 0.75rem;
    text-align: center;
    vertical-align: middle;
}

/* --- UTILITY CLASSES --- */
.text-primary-blue { color: var(--primary-blue) !important; }
.text-secondary-green { color: var(--secondary-green) !important; }
.bg-primary-blue { background-color: var(--primary-blue) !important; }
.bg-secondary-green { background-color: var(--secondary-green) !important; }
.text-light { color: var(--text-light) !important; }
.text-muted { color: var(--text-muted) !important; }

/* --- VALIDATION STATS --- */
.validation-stat {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- ERROR LIST --- */
.error-list {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.error-list ul {
    margin: 0;
    padding-left: 1.5rem;
}

.error-list li {
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

/* --- ACTION BUTTONS --- */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* --- ACCORDION STYLES --- */
.accordion-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-dark) !important;
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
}

.accordion-button {
    background: var(--card-bg) !important;
    color: var(--text-light) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background: #1e293b !important;
    color: var(--text-light) !important;
    box-shadow: none !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25) !important;
}

.accordion-body {
    background: #1e293b !important;
    color: var(--text-light) !important;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-dark);
}

/* --- ROW DATA STYLES --- */
.row-data {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.row-data .badge {
    margin-left: 0.5rem;
}

/* --- HIDDEN ACCORDION ITEMS --- */
.accordion-item[style*="display: none"] {
    display: none !important;
} 

/* --- CHAT COMPOSER --- */
.chat-composer-inner {
    background: #1e293b;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-dark);
}

.chat-composer-inner:focus-within {
    border-color: var(--primary-blue);
}

.btn-icon {
    background: none;
  border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-icon:hover {
    color: var(--primary-blue);
}

.bg-dark-subtle {
    background: #1e293b !important;
}

/* --- CHAT COMPOSER OVERRIDES --- */
.chat-composer textarea.form-control {
    background: transparent !important;
    border: none !important;
    color: var(--text-light) !important;
  resize: none;
    padding: 0;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 60px;
    max-height: 120px;
}

.chat-composer textarea.form-control:focus {
    box-shadow: none !important;
    outline: none !important;
}

.chat-composer .btn.rounded-pill, .chat-composer .btn.rounded-pill:focus {
    background: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    color: #fff !important;
}

.chat-composer .btn.rounded-pill:hover {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
} 

.chat-placeholder {
    color: var(--text-muted) !important;
    font-style: italic;
} 

/* --- FORM PLACEHOLDER OVERRIDES --- */
.form-control::placeholder {
    color: var(--text-muted) !important;
  opacity: 0.7 !important;
} 

/* --- NAVBAR ACTIONS --- */
.navbar-actions .dropdown-menu {
    background: #1e293b !important;
    border: 1px solid var(--border-dark) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
    z-index: 1001 !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
}

.navbar-actions .dropdown-item {
    color: var(--text-light) !important;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.navbar-actions .dropdown-item:hover, .navbar-actions .dropdown-item:focus {
    background: var(--primary-blue) !important;
    color: #fff !important;
}

.navbar-actions img[alt="Avatar"] {
    border: 2px solid var(--primary-blue);
    transition: border-color 0.2s ease;
}

.navbar-actions img[alt="Avatar"]:hover {
    border-color: var(--secondary-green);
}

/* --- MAPPING SECTION STYLES --- */
.mapping-section {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-dark);
}

.mapping-section h6 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mapping-section .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.mapping-section .form-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --- ACTIVE WORKFLOW STEP STYLES --- */
.workflow-step.active {
    transform: scale(1.05);
}

.workflow-step.active small {
    color: var(--primary-blue);
    font-weight: 600;
}

/* --- IMPROVED CARD HEADERS --- */
.card-header h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.card-header small {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* --- BUTTON SIZE IMPROVEMENTS --- */
.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- MODAL IMPROVEMENTS --- */
.modal-body {
    padding: 2rem;
}

.modal-body .text-center {
    padding: 1rem 0;
}

/* --- ALERT IMPROVEMENTS --- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert i {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* --- TABLE IMPROVEMENTS --- */
.table th.text-center,
.table td.text-center {
    text-align: center !important;
}

/* Elegant Table Styles */
.elegant-table {
    background: var(--card-bg) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

 .elegant-table thead th {
     background: var(--card-bg) !important;
     color: var(--text-light) !important;
     font-weight: 500 !important;
     font-size: 0.9rem !important;
     padding: 0.75rem !important;
     border-bottom: 2px solid var(--primary-blue) !important;
     position: relative !important;
 }

 .elegant-table thead th:not(:last-child)::after {
     content: '';
     position: absolute;
     right: 0;
     top: 20%;
     height: 60%;
     width: 1px;
     background: var(--border-dark);
 }

.elegant-table tbody tr {
    background: var(--background-dark-alt) !important;
    transition: all 0.2s ease-in-out !important;
    border-bottom: 1px solid var(--border-dark) !important;
}

.elegant-table tbody tr:hover {
    background: #1e293b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.elegant-table tbody tr:nth-child(even) {
    background: #1a1f2e !important;
}

.elegant-table tbody tr:nth-child(even):hover {
    background: #1e293b !important;
}

.elegant-table tbody td {
    padding: 1rem 0.75rem !important;
    color: var(--text-light) !important;
    font-size: 0.9rem !important;
    border: none !important;
    vertical-align: middle !important;
}

.elegant-table tbody td:first-child {
    font-weight: 500 !important;
}

 /* Responsive table improvements */
 @media (max-width: 768px) {
     .elegant-table thead th,
     .elegant-table tbody td,
     .table thead th,
     .table tbody td {
         padding: 0.75rem 0.5rem !important;
         font-size: 0.8rem !important;
     }

     .elegant-table thead th,
     .table thead th {
         font-size: 0.75rem !important;
     }
 }

 /* Enhanced horizontal scrolling for wide tables */
 .table-responsive {
     overflow-x: auto !important;
     scrollbar-width: thin !important;
     scrollbar-color: var(--primary-blue) var(--background-dark) !important;
 }

 .table-responsive::-webkit-scrollbar {
     height: 8px !important;
 }

 .table-responsive::-webkit-scrollbar-track {
     background: var(--background-dark) !important;
     border-radius: 4px !important;
 }

 .table-responsive::-webkit-scrollbar-thumb {
     background: var(--primary-blue) !important;
     border-radius: 4px !important;
 }

 .table-responsive::-webkit-scrollbar-thumb:hover {
     background: #1e40af !important;
 }

 /* Ensure table cells don't wrap unnecessarily */
 .elegant-table tbody td,
 .table tbody td {
     white-space: nowrap !important;
     max-width: 200px !important;
     overflow: hidden !important;
     text-overflow: ellipsis !important;
     position: relative !important;
 }

 .elegant-table tbody td:hover {
     white-space: normal !important;
     word-wrap: break-word !important;
     max-width: none !important;
     z-index: 10 !important;
     background: var(--card-bg) !important;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
 }

 .elegant-table thead th {
     white-space: nowrap !important;
     min-width: 120px !important;
 }

 /* Compact column display styles */
 .column-item {
     transition: all 0.2s ease-in-out !important;
     cursor: pointer !important;
 }

 .column-item:hover {
     background: var(--card-bg) !important;
     border-color: var(--primary-blue) !important;
     transform: translateY(-1px) !important;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
 }

 .column-name {
     font-size: 0.8rem !important;
     line-height: 1.2 !important;
 }

 .available-columns .row {
     max-height: 300px !important;
     overflow-y: auto !important;
     scrollbar-width: thin !important;
     scrollbar-color: var(--primary-blue) var(--background-dark) !important;
 }

 .available-columns .row::-webkit-scrollbar {
     width: 6px !important;
 }

 .available-columns .row::-webkit-scrollbar-track {
     background: var(--background-dark) !important;
     border-radius: 3px !important;
 }

 .available-columns .row::-webkit-scrollbar-thumb {
     background: var(--primary-blue) !important;
     border-radius: 3px !important;
 }

 /* Flash Messages Styling */
 .flash-messages-container {
     position: fixed !important;
     top: 100px !important;
     right: 20px !important;
     z-index: 9999 !important;
     max-width: 400px !important;
     width: 100% !important;
 }

 .flash-messages-container .alert {
     background: var(--card-bg) !important;
     border: 1px solid var(--border-dark) !important;
     border-radius: 8px !important;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
     margin-bottom: 10px !important;
     backdrop-filter: blur(10px) !important;
 }

 .flash-messages-container .alert-danger {
     border-left: 4px solid #dc3545 !important;
     color: #ff6b6b !important;
 }

 .flash-messages-container .alert-success {
     border-left: 4px solid #28a745 !important;
     color: #51cf66 !important;
 }

 .flash-messages-container .alert-info {
     border-left: 4px solid #17a2b8 !important;
     color: #74c0fc !important;
 }

 .flash-messages-container .alert-warning {
     border-left: 4px solid #ffc107 !important;
     color: #ffd43b !important;
 }

 .flash-messages-container .btn-close {
     filter: invert(1) !important;
     opacity: 0.7 !important;
 }

 .flash-messages-container .btn-close:hover {
     opacity: 1 !important;
 }

 /* Error Table Specific Styles */
 .accordion-body .elegant-table {
     margin-bottom: 0 !important;
 }

 .accordion-body .table-responsive {
     border-radius: 8px !important;
     overflow: hidden !important;
 }

 /* Highlight problematic cells in error tables */
 .elegant-table .bg-warning {
     background: linear-gradient(135deg, #ffc107, #ffb300) !important;
     color: #000 !important;
     font-weight: 600 !important;
     position: relative !important;
 }

 .elegant-table .bg-warning::before {
     content: '⚠️' !important;
     position: absolute !important;
     top: 2px !important;
     right: 2px !important;
     font-size: 0.7rem !important;
     opacity: 0.8 !important;
 }

 /* Error table hover effects */
 .accordion-body .elegant-table tbody tr:hover .bg-warning {
     background: linear-gradient(135deg, #ffca2c, #ffc107) !important;
     transform: scale(1.02) !important;
     box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3) !important;
 }

 /* Workflow Card Consistency */
 .workflow-card {
     display: flex !important;
     flex-direction: column !important;
     min-height: 420px !important;
 }

 .workflow-content {
     flex: 1 !important;
     display: flex !important;
     flex-direction: column !important;
 }

 .workflow-description {
     flex: 1 !important;
     margin-bottom: 1.5rem !important;
 }

 .workflow-footer {
     margin-top: auto !important;
 }

/* --- BADGE IMPROVEMENTS --- */
.badge.fs-6 {
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem;
} 