/* Container Layout Styles */

/* Data Container */
.data-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem;
    min-height: 500px;
}

.tables-container {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.data-panel {
    flex: 1;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.data-panel .panel-header {
    background: white;
    color: #334155;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.panel-header-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-toggles-header {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.data-panel .panel-header h2 {
    color: #1976d2;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Disclaimer styling */
.disclaimer {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
    font-style: italic;
    opacity: 0.8;
}

.record-count {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    width: 100px;
    text-align: center;
    white-space: nowrap;
    display: inline-block;
}

.table-container {
    flex: 1;
    overflow: auto;
    border-radius: 0 0 8px 8px;
}


/* Loading Indicator */
.loading {
    padding: 2rem;
    margin: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Status Bar */
.status-bar {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 1rem;
    padding: 12px 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.status-text {
    color: #374151;
    font-weight: normal;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.4;
}

/* Status Bar Loading State */
.status-bar.status-loading {
    background: linear-gradient(90deg, #fff3cd 0%, #fef3c7 50%, #fff3cd 100%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s ease-in-out infinite;
    border-color: #f59e0b;
}

.status-bar.status-loading .status-text {
    color: #d97706;
    position: relative;
}

.status-bar.status-loading .status-text::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid #f59e0b;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: loading-spinner 1s linear infinite;
    vertical-align: middle;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes loading-spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Status Bar Error State */
.status-bar.status-error .status-text {
    color: #dc2626;
}

/* Status Bar Success State */
.status-bar.status-success {
    background: linear-gradient(90deg, #d1fae5 0%, #a7f3d0 50%, #d1fae5 100%);
    background-size: 200% 100%;
    animation: success-shimmer 2s ease-in-out infinite;
    border-color: #059669;
}

.status-bar.status-success .status-text {
    color: #059669;
    position: relative;
}

.status-bar.status-success .status-text::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid #059669;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: success-spinner 1s linear infinite;
    vertical-align: middle;
}

@keyframes success-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes success-spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animation for loading state */
@keyframes pulse-loading {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation for error state */
@keyframes pulse-error {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Container Adjustments */
@media (max-width: 1200px) {
    .data-container {
        flex-direction: column;
        height: auto;
    }

    .data-panel {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .data-container {
        margin: 0.5rem;
    }
}