/* LexiAI Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom focus styles */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Textarea auto-resize placeholder */
.textarea-auto {
    field-sizing: content;
    min-height: 200px;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Slide up animation */
.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Toast notification styles */
.toast {
    animation: toastIn 0.3s ease-out;
}

.toast.toast-out {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Text highlight for corrections */
.highlight-error {
    background-color: #fecaca;
    border-bottom: 2px solid #ef4444;
    cursor: pointer;
}

.highlight-warning {
    background-color: #fef08a;
    border-bottom: 2px solid #eab308;
    cursor: pointer;
}

.highlight-suggestion {
    background-color: #bfdbfe;
    border-bottom: 2px solid #3b82f6;
    cursor: pointer;
}

/* Diff highlighting */
.diff-added {
    background-color: #dcfce7;
    color: #166534;
}

.diff-removed {
    background-color: #fecaca;
    color: #991b1b;
    text-decoration: line-through;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e5e7eb;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 50;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Card hover effect */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Mode button styles */
.mode-btn {
    transition: all 0.2s;
}

.mode-btn.active {
    background-color: #22c55e;
    color: white;
    border-color: #22c55e;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Word counter stats */
.stat-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dropdown menu animation */
.dropdown-menu {
    transform-origin: top;
    transition: opacity 0.15s, transform 0.15s;
}

.dropdown-menu.hidden {
    opacity: 0;
    transform: scaleY(0.95);
    pointer-events: none;
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Tool editor container */
.tool-editor {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
}

/* Character/word limit warning */
.limit-warning {
    color: #eab308;
}

.limit-exceeded {
    color: #ef4444;
}

/* Responsive text area */
@media (max-width: 768px) {
    .tool-editor {
        min-height: 200px;
        max-height: 300px;
    }
}
