/* CSS Formatter & Beautifier Advanced Styles */

/* Enhanced animations and transitions */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Processing states */
.processing {
    position: relative;
    overflow: hidden;
}

.processing::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Color palette grid */
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.color-swatch::after {
    content: attr(data-color);
    position: absolute;
    bottom: -24px;
    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;
}

.color-swatch:hover::after {
    opacity: 1;
}

/* Code syntax highlighting */
.css-code {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
}

.css-selector {
    color: #7c2d12;
    font-weight: 600;
}

.css-property {
    color: #1e40af;
}

.css-value {
    color: #059669;
}

.css-comment {
    color: #6b7280;
    font-style: italic;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Progress bars */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Enhanced buttons */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
}

/* Modal animations */
.modal.show {
    animation: modalFadeIn 0.3s ease-out;
}

.modal.hide {
    animation: modalFadeOut 0.3s ease-in;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Drag and drop styles */
.drag-over {
    border-color: #6366f1 !important;
    background-color: #f0f4ff !important;
}

.drag-over::after {
    content: "Drop CSS file here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #6366f1;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
}

/* Responsive design */
@media (max-width: 768px) {
    .grid.grid-cols-1.lg\\:grid-cols-2 {
        gap: 1rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .flex.flex-wrap.gap-2 {
        gap: 0.5rem;
    }

    .color-swatch {
        width: 24px;
        height: 24px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .css-code {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .css-selector {
        color: #fbbf24;
    }

    .css-property {
        color: #60a5fa;
    }

    .css-value {
        color: #34d399;
    }

    .css-comment {
        color: #9ca3af;
    }
}

/* Custom scrollbars */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Enhanced focus styles */
.focus-enhanced:focus {
    outline: none;
    ring: 2px;
    ring-color: #6366f1;
    ring-offset: 2px;
    ring-offset-color: #ffffff;
}

/* Notification enhancements */
.notification {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification.success {
    background: rgba(34, 197, 94, 0.9);
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
}

.notification.warning {
    background: rgba(245, 158, 11, 0.9);
}

.notification.info {
    background: rgba(59, 130, 246, 0.9);
}
