@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Component Classes complementing Tailwind */
@layer components {
    .btn {
        @apply px-4 py-2 bg-gray-50 hover:bg-gray-100 dark:bg-dark-800 dark:hover:bg-dark-700 text-gray-700 dark:text-gray-200 border border-gray-200 dark:border-dark-700 rounded-lg text-sm font-medium transition-colors shadow-sm;
    }
}

/* Swatch Card Animations & Hover States */
.swatch-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.swatch-color {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); /* Subtle inner border for white/light colors */
    position: relative;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    overflow: hidden;
}

.swatch-color:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 10;
}

.swatch-color:active {
    transform: scale(0.95);
}

.dark .swatch-color {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* Contrast indicator overlay inside swatch */
.contrast-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s;
}

.swatch-color:hover .contrast-check {
    opacity: 1;
}

/* Label below swatch */
.swatch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
}

.swatch-name {
    color: theme('colors.gray.600');
}
.dark .swatch-name {
    color: theme('colors.gray.400');
}

.swatch-hex {
    font-family: theme('fontFamily.mono');
    color: theme('colors.gray.400');
    transition: color 0.2s;
}
.swatch-group:hover .swatch-hex {
    color: theme('colors.gray.900');
}
.dark .swatch-hex {
    color: theme('colors.gray.500');
}
.dark .swatch-group:hover .swatch-hex {
    color: theme('colors.gray.200');
}

/* Modal Entry Animation */
#export-modal:not(.hidden) > div:nth-child(2) {
    animation: modal-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modal-enter {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
