/**
 * Brand Color Extractor Custom Styles
 */

/* Tab Navigation Styles */
.results-tab-button {
    @apply text-gray-600 bg-transparent border-0 outline-none;
    transition: all 0.2s ease-in-out;
}

.results-tab-button:hover {
    @apply text-gray-800 bg-gray-100;
}

.results-tab-button.active {
    @apply text-purple-600 bg-white border border-gray-200 shadow-sm;
    border-bottom-color: white;
    margin-bottom: -1px;
}

.results-tab-button.active svg {
    @apply text-purple-600;
}

/* Color Preview Animation */
#color-preview {
    transition: background-color 0.2s ease-in-out;
}

/* Quick Color Buttons */
.quick-color {
    transition: transform 0.2s ease-in-out;
    position: relative;
}

.quick-color:hover {
    transform: scale(1.05);
}

.quick-color::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.quick-color:hover::after {
    opacity: 1;
}

/* Color Scheme Grid */
.color-scheme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

/* Color Swatch Hover Effects */
.color-swatch {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-swatch::after {
    content: "Click to copy";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.color-swatch:hover::after {
    opacity: 1;
}

/* Copy Button Styles */
.copy-btn {
    transition: all 0.2s ease-in-out;
}

.copy-btn:hover {
    transform: translateY(-1px);
}

/* Code Block Styling */
.export-code {
    font-family: "JetBrains Mono", "Fira Code", "Monaco", "Cascadia Code", "Roboto Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
    overflow-x: auto;
}

/* Accessibility Badge Styles */
.accessibility-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accessibility-badge.aaa {
    @apply bg-green-100 text-green-800;
}

.accessibility-badge.aa {
    @apply bg-blue-100 text-blue-800;
}

.accessibility-badge.aa-large {
    @apply bg-yellow-100 text-yellow-800;
}

.accessibility-badge.fail {
    @apply bg-red-100 text-red-800;
}

/* UI Variation Preview */
.ui-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.ui-preview:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Color Name Display */
.color-name {
    font-weight: 600;
    text-transform: capitalize;
}

.color-hex {
    font-family: "JetBrains Mono", "Monaco", monospace;
    font-size: 12px;
    opacity: 0.7;
}

/* Loading States */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Results Animation */
.results-section {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Content Animation */
.results-tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Color Grid Responsive */
@media (max-width: 640px) {
    .color-scheme-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .color-swatch::after {
        display: none;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .color-scheme-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Contrast Ratio Display */
.contrast-ratio {
    font-family: "JetBrains Mono", "Monaco", monospace;
    font-weight: 600;
    font-size: 14px;
}

/* Export Format Tabs */
.export-format-tab {
    @apply px-4 py-2 text-sm font-medium border-b-2 border-transparent;
    transition: all 0.2s ease-in-out;
}

.export-format-tab:hover {
    @apply text-gray-800 border-gray-300;
}

.export-format-tab.active {
    @apply text-purple-600 border-purple-600;
}

/* Color Harmony Indicator */
.harmony-indicator {
    position: relative;
    display: inline-block;
}

.harmony-indicator::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid currentColor;
    border-radius: inherit;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Responsive Design Improvements */
@media (max-width: 768px) {
    .results-tab-button span {
        @apply text-xs;
    }

    .results-tab-button svg {
        @apply w-3 h-3;
    }

    .ui-preview {
        flex-direction: column;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .copy-btn,
    .results-tab-button,
    #extract-btn {
        display: none !important;
    }

    .results-tab-content {
        display: block !important;
    }

    .color-swatch::after {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .color-swatch {
        border-width: 2px;
    }

    .results-tab-button.active {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .color-swatch,
    .quick-color,
    .ui-preview,
    .results-tab-button {
        transition: none;
    }

    .results-section,
    .results-tab-content {
        animation: none;
    }

    .harmony-indicator::before {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.copy-btn:focus,
.quick-color:focus,
.results-tab-button:focus {
    @apply outline-none ring-2 ring-purple-500 ring-offset-2;
}

.color-swatch:focus {
    @apply outline-none ring-2 ring-purple-500 ring-offset-2;
    transform: scale(1.05);
}

/* Custom Scrollbar for Code Blocks */
.export-code::-webkit-scrollbar {
    height: 6px;
}

.export-code::-webkit-scrollbar-track {
    @apply bg-gray-700;
}

.export-code::-webkit-scrollbar-thumb {
    @apply bg-gray-500 rounded;
}

.export-code::-webkit-scrollbar-thumb:hover {
    @apply bg-gray-400;
}
