/* Color Code Converter Custom Styles */

/* Format Tab Transitions */
.format-tab {
    transition: all 0.2s ease-in-out;
}

.format-tab.active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Input Group Animations */
.input-group {
    transition: opacity 0.3s ease-in-out;
}

.input-group.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Color Preview Enhancements */
#colorPreview {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

#colorPreview::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.1) 49%, rgba(255, 255, 255, 0.1) 51%, transparent 52%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Preset Color Hover Effects */
.preset-color {
    position: relative;
    transition: all 0.2s ease-in-out;
}

.preset-color:hover {
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preset-color::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 20;
}

.preset-color:hover::after {
    opacity: 1;
}

/* Copy Button Animations */
.copy-btn {
    transition: all 0.2s ease-in-out;
}

.copy-btn:hover {
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Info Tab Active State */
.info-tab.active {
    position: relative;
}

.info-tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

/* Loading Spinner Enhancement */
#loadingState {
    backdrop-filter: blur(2px);
    background: rgba(255, 255, 255, 0.9);
}

/* Success Message Animation */
#successMessage {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error Display Enhancement */
#errorDisplay {
    border-left: 4px solid #ef4444;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Color Format Cards */
.converted-formats .bg-gray-50 {
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
}

.converted-formats .bg-gray-50:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Color Scheme Hover Effects */
.color-scheme-item {
    transition: all 0.2s ease-in-out;
}

.color-scheme-item:hover {
    background-color: #f8fafc;
    transform: translateX(4px);
}

/* WCAG Compliance Indicators */
.wcag-pass {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
}

.wcag-fail {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .format-tab {
        font-size: 12px;
        padding: 8px 12px;
    }

    #colorPreview {
        height: 120px;
    }

    .preset-color {
        width: 24px;
        height: 24px;
    }

    .info-tab {
        font-size: 12px;
        padding: 12px 16px;
    }
}

/* Dark Mode Support (if needed later) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .format-tab {
        border: 2px solid;
    }

    .preset-color {
        border: 3px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #colorPreview::before {
        animation: none;
    }
}
