/* Accessible Contrast Checker Custom Styles */

/* Enhanced color picker styling */
#foreground-picker,
#background-picker {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
}

#foreground-picker:hover,
#background-picker:hover {
    border-color: #6366f1;
    transform: scale(1.05);
}

/* Color preview enhancements */
#foreground-preview,
#background-preview {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#foreground-preview::before,
#background-preview::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 47%, rgba(255, 255, 255, 0.1) 49%, rgba(255, 255, 255, 0.1) 51%, transparent 53%);
    pointer-events: none;
}

/* Preset button hover effects */
.preset-combo {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.preset-combo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preset-combo:active {
    transform: translateY(0);
}

/* Results section animations */
#results-section {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab transition effects */
.results-tab-content {
    transition: all 0.3s ease;
}

.results-tab-content.hidden {
    opacity: 0;
    pointer-events: none;
}

.results-tab-content:not(.hidden) {
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Live preview styling */
#preview-content .border-dashed {
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.1) 1px, transparent 0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Contrast ratio display */
#contrast-result {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Status indicator styling */
.contrast-status-indicator {
    position: relative;
    transition: all 0.3s ease;
}

.contrast-status-indicator::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    border-radius: 50%;
    z-index: 1;
}

.contrast-status-indicator .status-icon {
    position: relative;
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

/* Enhanced button animations */
#check-contrast-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#check-contrast-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

#check-contrast-btn:active {
    transform: translateY(0);
}

#check-contrast-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading spinner enhancement */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Copy button effects */
.copy-color-btn {
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
}

.copy-color-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

/* Alternative suggestions cards */
#alternative-suggestions .hover\:shadow-md:hover {
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

/* Accessibility status indicators */
.text-green-600 {
    color: #059669 !important;
}

.text-blue-600 {
    color: #2563eb !important;
}

.text-red-600 {
    color: #dc2626 !important;
}

.bg-green-100 {
    background-color: #dcfce7 !important;
}

.bg-blue-100 {
    background-color: #dbeafe !important;
}

.bg-red-100 {
    background-color: #fee2e2 !important;
}

.text-green-800 {
    color: #166534 !important;
}

.text-blue-800 {
    color: #1e40af !important;
}

.text-red-800 {
    color: #991b1b !important;
}

/* Educational content styling */
.educational-content {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #contrast-result .flex-col {
        align-items: flex-start !important;
    }

    #contrast-result .text-right {
        text-align: left;
        margin-top: 1rem;
    }

    .preset-combo {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .border-gray-200 {
        border-color: #374151 !important;
    }

    .border-gray-300 {
        border-color: #4b5563 !important;
    }

    .text-gray-600 {
        color: #1f2937 !important;
    }
}

/* Focus indicators for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Color input validation states */
.color-input-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.color-input-valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Smooth transitions for all interactive elements */
* {
    scroll-behavior: smooth;
}

/* Print styles */
@media print {
    #check-contrast-btn,
    .preset-combo,
    #foreground-picker,
    #background-picker {
        display: none !important;
    }

    #preview-content {
        break-inside: avoid;
    }

    .bg-gray-50 {
        background-color: #ffffff !important;
    }
}
