/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    padding: 1rem;
}

@media (min-width: 640px) {
    body {
        padding: 2rem;
    }
}

/* Layout */
.max-w-4xl {
    max-width: 56rem;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 2rem;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-start {
    align-items: flex-start;
}

/* Spacing */
.mb-8 {
    margin-bottom: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.p-6 {
    padding: 1.5rem;
}

/* Typography */
.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.font-bold {
    font-weight: 700;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

.capitalize {
    text-transform: capitalize;
}

/* Colors */
.text-gray-800 {
    color: #1f2937;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-500 {
    color: #6b7280;
}

.bg-white {
    background-color: #ffffff;
}

/* Border and Border Radius */
.rounded-xl {
    border-radius: 0.75rem;
}

/* Card layout */
.card-container {
    border: 1px solid #d1d5db;
    height: 540px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-header {
    flex-shrink: 0;
}

.card-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 5;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.card-spinner.hidden {
    opacity: 0;
    visibility: hidden;
}

.card-spinner .spinner-circle {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: card-spin 0.9s linear infinite;
}

@keyframes card-spin {
    to { transform: rotate(360deg); }
}

/* Loading and error states */
#loading-indicator {
    text-align: center; 
    padding: 50px; 
    display: none;
}

#error-message { 
    color: red; 
    padding: 10px; 
    display: none; 
    background: #ffe6e6; 
    border: 1px solid #ff9999; 
    margin-bottom: 20px;
    border-radius: 0.375rem;
}

.header { 
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #eee; 
}

.date-info { 
    color: #666; 
    font-size: 14px; 
}

.search-bar {
    margin-top: 1rem;
    display: none;
}

#integrator-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#integrator-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #6b7280;
    background-color: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 0.75rem;
    font-size: 0.95rem;
}

/* Log Viewer Modal */
.log-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.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.log-modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 2rem;
    padding: 0;
    border-radius: 0.75rem;
    width: calc(100% - 4rem);
    max-width: 1400px;
    max-height: calc(100vh - 4rem);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalFadeIn 0.3s ease-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.log-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.log-modal-close:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

.log-modal-close:active {
    transform: scale(0.95);
}

#global-log-viewer {
    width: 100%;
    flex: 1;
    min-height: 0;
}
