/* GraphQL Formatter Styles */

/* Syntax highlighting for GraphQL in textareas */
#graphqlInput,
#graphqlOutput,
#variableQuery,
#variableJson,
#generatedTypes {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    line-height: 1.5;
    tab-size: 2;
}

/* Enhanced focus states */
#graphqlInput:focus,
#graphqlOutput:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    border-color: rgb(99, 102, 241);
}

/* Loading states */
.processing #graphqlOutput {
    background-image: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Quick action buttons hover effects */
.quick-action-btn:hover {
    transform: translateY(-2px);
}

.quick-action-btn:active {
    transform: translateY(0);
}

/* Sample query cards */
.sample-query:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Complexity bar animations */
#complexityBar {
    transition: width 0.8s ease-in-out, background-color 0.3s ease;
}

.complexity-low {
    background-color: #10b981 !important;
}
.complexity-medium {
    background-color: #f59e0b !important;
}
.complexity-high {
    background-color: #ef4444 !important;
}

/* Validation results styling */
.validation-success {
    background-color: rgb(240, 253, 244);
    border: 1px solid rgb(34, 197, 94);
    color: rgb(22, 163, 74);
}

.validation-error {
    background-color: rgb(254, 242, 242);
    border: 1px solid rgb(239, 68, 68);
    color: rgb(220, 38, 38);
}

.validation-warning {
    background-color: rgb(255, 251, 235);
    border: 1px solid rgb(245, 158, 11);
    color: rgb(217, 119, 6);
}

/* Copy/Download button animations */
.btn-copy:hover,
.btn-download:hover {
    transform: scale(1.05);
}

.btn-copy.success {
    background-color: rgb(34, 197, 94) !important;
    color: white !important;
    border-color: rgb(34, 197, 94) !important;
}

/* Error state styling */
.error-state {
    border-color: rgb(239, 68, 68) !important;
    background-color: rgb(254, 242, 242) !important;
}

.error-state:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Status indicators */
.status-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-success {
    background-color: rgb(34, 197, 94);
}
.status-error {
    background-color: rgb(239, 68, 68);
}
.status-warning {
    background-color: rgb(245, 158, 11);
}
.status-processing {
    background-color: rgb(99, 102, 241);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-cols-2.md\\:grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    #graphqlInput,
    #graphqlOutput {
        height: 250px;
    }

    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    .grid-cols-2.md\\:grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .text-4xl {
        font-size: 2rem;
    }

    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Light theme optimizations */
.bg-white {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
}

.text-gray-900 {
    color: #111827;
}

.text-gray-600 {
    color: #4b5563;
}

.bg-gray-50 {
    background-color: #f9fafb;
}

/* Custom scrollbars */
#graphqlInput::-webkit-scrollbar,
#graphqlOutput::-webkit-scrollbar,
#variableQuery::-webkit-scrollbar,
#variableJson::-webkit-scrollbar,
#generatedTypes::-webkit-scrollbar {
    width: 8px;
}

#graphqlInput::-webkit-scrollbar-track,
#graphqlOutput::-webkit-scrollbar-track,
#variableQuery::-webkit-scrollbar-track,
#variableJson::-webkit-scrollbar-track,
#generatedTypes::-webkit-scrollbar-track {
    background: rgb(243, 244, 246);
    border-radius: 4px;
}

#graphqlInput::-webkit-scrollbar-thumb,
#graphqlOutput::-webkit-scrollbar-thumb,
#variableQuery::-webkit-scrollbar-thumb,
#variableJson::-webkit-scrollbar-thumb,
#generatedTypes::-webkit-scrollbar-thumb {
    background: rgb(156, 163, 175);
    border-radius: 4px;
}

#graphqlInput::-webkit-scrollbar-thumb:hover,
#graphqlOutput::-webkit-scrollbar-thumb:hover,
#variableQuery::-webkit-scrollbar-thumb:hover,
#variableJson::-webkit-scrollbar-thumb:hover,
#generatedTypes::-webkit-scrollbar-thumb:hover {
    background: rgb(107, 114, 128);
}

/* Fade-in animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Slide-up animations */
.slide-up {
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Progress indicators */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dasharray 0.3s ease-in-out;
    fill: transparent;
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #374151;
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #374151;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Field highlighting */
.field-highlight {
    background-color: rgba(99, 102, 241, 0.1);
    border-left: 3px solid rgb(99, 102, 241);
    padding-left: 0.5rem;
}

/* Type badges */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #f3f4f6;
    color: #4b5563;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    border: 1px solid #e5e7eb;
}

.type-badge.scalar {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
.type-badge.object {
    background-color: #ecfeff;
    color: #0891b2;
    border-color: #a7f3d0;
}
.type-badge.enum {
    background-color: #fff7ed;
    color: #ea580c;
    border-color: #fed7aa;
}
.type-badge.interface {
    background-color: #faf5ff;
    color: #9333ea;
    border-color: #e9d5ff;
}
.type-badge.union {
    background-color: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

/* Code block styling */
.code-block {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
    color: #374151;
}

/* Performance indicators */
.perf-excellent {
    color: rgb(34, 197, 94);
}
.perf-good {
    color: rgb(59, 130, 246);
}
.perf-moderate {
    color: rgb(245, 158, 11);
}
.perf-poor {
    color: rgb(239, 68, 68);
}
.perf-critical {
    color: rgb(190, 18, 60);
}
