
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}


#ui-preview-wrapper button,
#ui-preview-wrapper a,
#ui-preview-card button,
#ui-preview-card a,
#preview-nav-link,
#preview-cta-small,
#preview-button,
#preview-link,
#preview-action-btn-1,
#preview-action-btn-2,
#preview-action-btn-3 {
    cursor: default !important;
    pointer-events: none !important;
    user-select: none !important;
}


#ui-preview-wrapper button:hover,
#ui-preview-card button:hover {
    transform: none !important;
    box-shadow: none !important;
}


.pro-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    transition: background 0.2s;
}

.pro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #4f46e5;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pro-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #4f46e5;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.brightness-slider {
    background: linear-gradient(to right, #000000, #e2e8f0, #ffffff) !important;
}

.saturation-slider {
    background: linear-gradient(to right, #94a3b8, #0891b2) !important;
}

.hue-slider {
    background: linear-gradient(to right, 
        #ff0000 0%, 
        #ffff00 17%, 
        #00ff00 33%, 
        #00ffff 50%, 
        #0000ff 67%, 
        #ff00ff 83%, 
        #ff0000 100%) !important;
}

.temperature-slider {
    background: linear-gradient(to right, #0077be, #e2e8f0, #ffc300) !important;
}


.refinement-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.5rem;
    color: #cbd5e1;
    transition: color 0.3s;
}

.refinement-indicator.active {
    color: #4f46e5;
    animation: pulse-indicator 2s infinite;
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 1; }
    50% {
        transform: scale(1.2);
    }
}

label i.fa-star {
    animation: starPulse 2s ease-in-out infinite;
}


#random-base-color-btn {
    position: relative;
    overflow: hidden;
}

#random-base-color-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#random-base-color-btn:active::before {
    width: 300px;
    height: 300px;
}

@media (max-width: 640px) {
    .base-color-preview {
        width: 120px;
        height: 120px;
    }
    
    .base-color-random-btn {
        width: 120px;
    }
}


.refinement-preview {
    display: none;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s;
}

.refinement-preview.show {
    display: block;
}


.tab-btn.active {
    background-color: #4f46e5;
    color: #ffffff;
}

.tab-panel { 
    display: none; 
}

.tab-panel.active { 
    display: block; 
}


@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


#image-upload-area.dragover {
    border-color: #4f46e5;
    background-color: #eef2ff;
}


.contrast-cell.pass-aaa { 
    background-color: #166534; 
    color: white; 
}

.contrast-cell.pass-aa { 
    background-color: #15803d; 
    color: white; 
}

.contrast-cell.pass-ui { 
    background-color: #ca8a04; 
    color: white; 
}

.contrast-cell.fail { 
    background-color: #b91c1c; 
    color: white; 
}

.contrast-cell.selected {
    outline: 3px solid #4f46e5;
    outline-offset: -2px;
    z-index: 10;
    position: relative;
}


.tooltip {
    position: fixed;
    background-color: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    transform: translateY(5px);
    max-width: 250px;
    text-align: center;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}


.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 350px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: #166534;
}

.toast-error {
    background-color: #b91c1c;
}

.toast i {
    font-size: 1.2rem;
}


.color-card-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    transition: transform 0.2s;
    isolation: isolate;
}

.color-card-wrapper:hover {
    transform: scale(1.05);
}

.color-card-wrapper:hover .color-card {
    filter: none;
}

.color-card-wrapper.selected {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

.custom-color-input {
    position: absolute;
    visibility: hidden;
    width: 1px;
    height: 1px;
    top: -10px;
    left: -10px;
}


#palette-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    #palette-display {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 639px) {
    #palette-display {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    #palette-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}


.color-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px;
    transition: none;
    position: relative;
}

.color-card .hex-code {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.color-card .actions {
    display: none;
    justify-content: center;
    gap: 6px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 10;
}

.color-card-wrapper:hover .actions {
    display: flex;
}


.color-card-wrapper:hover .hex-code {
    display: block;
}

.color-card-wrapper .actions button {
    width: 32px; 
    height: 32px;
    transition: all 0.2s;
}

.color-card-wrapper .actions button:hover {
    transform: scale(1.1);
}

.color-card-wrapper .actions button i {
    font-size: 14px;
}


.color-card-wrapper.locked .lock-color-btn .fa-unlock { 
    display: none; 
}

.color-card-wrapper:not(.locked) .lock-color-btn .fa-lock { 
    display: none; 
}





.color-card-wrapper.locked::before {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: #4f46e5;
    color: white;
    border-radius: 6px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}


.color-card-wrapper.base-color::after {
    content: '\f005';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-radius: 6px;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}


.color-card-wrapper.base-color.locked::after {
    left: 6px;
    right: auto;
}

.color-card-wrapper.base-color.locked::before {
    right: 6px;
    left: auto;
}


.copy-all-menu {
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 4px;
    z-index: 1000;
    min-width: 180px;
    animation: slideUp 0.2s ease-out;
}

.copy-all-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #1e293b;
    transition: background 0.2s;
}

.copy-all-menu button:hover {
    background: #f1f5f9;
}


.history-dropdown-menu {
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 400px; 
    max-height: 500px; 
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.875rem;
}

.clear-history-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.history-list {
    max-height: 440px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.history-item:hover {
    background: #f8fafc;
}

.history-item:last-child {
    border-bottom: none;
}


.history-colors-wrapper {
    flex: 1;
    min-width: 0; 
}

.history-colors {
    display: flex;
    gap: 1px;
    width: 100%;
    height: 32px; 
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-color-preview {
    flex: 1;
    min-width: 0; 
    height: 100%;
    border: none;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0; 
    min-width: 100px;
}

.history-count {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.history-date {
    font-size: 0.75rem;
    color: #64748b;
}


.action-buttons-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn i {
    font-size: 1rem;
}

.action-btn-primary {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.action-btn-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn:disabled:hover {
    transform: none;
}

#copy-all-btn span {
    display: inline !important;
}


kbd {
    display: inline-block;
    padding: 3px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #1e293b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}


@media (max-width: 640px) {
    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
    
    .history-dropdown-menu {
        width: calc(100vw - 32px);
        right: 16px !important;
        left: 16px;
    }
}


.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}


.color-card {
    transition: background-color 0.3s ease;
}


@media (max-width: 1024px) {
    #contrast-grid-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #contrast-grid {
        min-width: 600px;
    }
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.history-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}

.icon-btn:active {
    transform: scale(0.95);
}


.state-success {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

.state-error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}


.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}



#method-switcher-section {
    
}

#method-switcher-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 640px) {
    #method-switcher-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    #method-switcher-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 1280px) {
    #method-switcher-grid {
        gap: 0.75rem;
    }
    
    .method-name {
        font-size: 0.7rem;
    }
}

.method-switcher-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 70px;
    width: 100%;
}

.method-switcher-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.method-switcher-btn.active {
    background: #eef2ff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.method-preview {
    display: flex;
    gap: 1px;
    width: 100%;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.method-preview div {
    flex: 1;
}

.method-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 2px;
}

.method-switcher-btn.active .method-name {
    color: #4f46e5;
    font-weight: 800;
}

@keyframes methodSwitch {
    0% {
        opacity: 0.5;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.method-switching #palette-display {
    animation: methodSwitch 0.3s ease-out;
}

@media (max-width: 640px) {
    .method-switcher-btn {
        padding: 0.5rem 0.25rem;
        min-height: 65px;
    }
    
    .method-name {
        font-size: 0.6rem;
    }
    
    .method-preview {
        height: 24px;
    }
}

.method-switcher-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.method-switcher-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}



.base-color-picker-large {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.base-color-preview {
    width: 140px;
    height: 140px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 5px solid white;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background: var(--base-color, #0891b2);
}

.base-color-preview::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 24px;
    background: transparent;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.group:hover .base-color-preview {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}


.base-color-random-btn {
    width: 140px;
    padding: 12px 16px;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}


.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


@media (max-width: 640px) {
    #ui-preview-card {
        padding: 1rem !important;
    }
    
    .preview-activity-badge {
        display: none;
    }
    
    .history-dropdown-menu {
        width: 320px;
    }
    
    .history-colors {
        height: 28px;
    }
}

@media (max-width: 1024px) {
    #preview-activity-title,
    #preview-actions-title,
    #preview-progress-title {
        font-size: 1rem;
    }
}
