/**
 * Page Asist - Custom Styles
 * Animații și stiluri suplimentare pentru UI
 */

/* Animații */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Clase de animații */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-slide-out {
    animation: slideOut 0.3s ease-out;
}

/* Message bubble styling */
.message-bubble {
    position: relative;
}

.message-bubble.streaming .message-content::after {
    content: '▋';
    animation: pulse 1s infinite;
    margin-left: 2px;
}

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

/* Custom scrollbar */
#chatContainer::-webkit-scrollbar {
    width: 8px;
}

#chatContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chatContainer::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#chatContainer::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Progress bar animation */
#progressBar {
    transition: width 0.5s ease-in-out;
}

/* Hover effects */
.message-bubble:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 8px;
    margin: -8px;
}

/* Button hover animations */
button {
    transition: all 0.2s ease-in-out;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Input focus effects */
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Role color badges */
.role-badge-generator {
    background-color: #10b981;
    color: white;
}

.role-badge-critic {
    background-color: #ef4444;
    color: white;
}

.role-badge-moderator {
    background-color: #3b82f6;
    color: white;
}

.role-badge-sintetizator {
    background-color: #f59e0b;
    color: white;
}

/* Modal backdrop */
#previewModal {
    backdrop-filter: blur(4px);
}

/* Loading spinner customization */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Card hover effect */
.hover\:shadow-md {
    transition: box-shadow 0.2s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #chatContainer {
        height: 400px;
    }
    
    .message-bubble {
        font-size: 0.875rem;
    }
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Status indicators */
.status-indicator {
    position: relative;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background-color: #ef4444;
}

/* Typing indicator */
@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Print styles */
@media print {
    header,
    button,
    #configForm {
        display: none;
    }
    
    #chatContainer {
        height: auto;
        overflow: visible;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .bg-white {
        background-color: #374151;
    }
    
    .text-gray-700 {
        color: #d1d5db;
    }
    
    .border-gray-200 {
        border-color: #4b5563;
    }
}

/* Accessibility improvements */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Selection styling */
::selection {
    background-color: #3b82f6;
    color: white;
}

/* Tooltip styling */
[title] {
    position: relative;
}

/* Icon animations */
.fa-sync-alt.fa-spin {
    animation: spin 1s linear infinite;
}

/* Success/Error state colors */
.state-success {
    border-left: 4px solid #10b981;
}

.state-error {
    border-left: 4px solid #ef4444;
}

.state-warning {
    border-left: 4px solid #f59e0b;
}

.state-info {
    border-left: 4px solid #3b82f6;
}

/* Code block styling (for formatted messages) */
pre {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* List styling in messages */
.message-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.message-content ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.message-content li {
    margin: 0.25rem 0;
}

/* Link styling */
a {
    transition: color 0.2s ease-in-out;
}

/* Disabled state */
button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

input:disabled,
select:disabled {
    cursor: not-allowed;
    background-color: #f3f4f6;
}

/* Badge styling */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Remove transition from elements that shouldn't have it */
input,
textarea,
select,
button {
    transition-property: background-color, border-color, box-shadow, transform;
}
