/* CSV to JSON Converter Advanced Styles */

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading-overlay {
    display: flex !important;
}

/* Table styles for preview */
.preview-table {
    font-size: 0.875rem;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    text-align: left;
    vertical-align: top;
}

.preview-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.preview-table tr:nth-child(even) {
    background-color: #f9fafb;
}

.preview-table tr:hover {
    background-color: #f3f4f6;
}

/* Tab navigation */
.tab-btn.active {
    color: #2563eb;
    border-color: #2563eb;
    background-color: #eff6ff;
}

.tab-btn:not(.active):hover {
    color: #374151;
    border-color: #d1d5db;
}

/* JSON syntax highlighting */
.json-output {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1f2937;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.json-string {
    color: #059669;
}

.json-number {
    color: #dc2626;
}

.json-boolean {
    color: #7c3aed;
}

.json-null {
    color: #6b7280;
}

.json-key {
    color: #1d4ed8;
    font-weight: 600;
}

/* Analysis styles */
.analysis-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.analysis-item h4 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.analysis-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
}

.analysis-card h5 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

.stat-value {
    color: #111827;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Validation styles */
.validation-success {
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.validation-warning {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.validation-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.validation-item {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.validation-item:last-child {
    margin-bottom: 0;
}

.validation-icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Progress indicators */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

/* File upload styles */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.file-upload-area.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: scale(1.02);
}

/* Responsive design */
@media (max-width: 768px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .preview-table {
        font-size: 0.75rem;
    }

    .preview-table th,
    .preview-table td {
        padding: 0.375rem;
    }

    .json-output {
        font-size: 0.75rem;
        padding: 0.75rem;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Copy button animation */
.copy-success {
    background-color: #10b981 !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Error message styles */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.success-message {
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Schema visualization */
.schema-container {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.875rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.schema-property {
    margin-left: 1rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.schema-type {
    color: #7c3aed;
    font-weight: 600;
}

.schema-required {
    color: #dc2626;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Sticky positioning for output panel */
@media (min-width: 1280px) {
    .sticky-output {
        position: sticky;
        top: 2rem;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Button hover effects */
.btn-hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
