/* Custom styles for LinguaTutor */

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

/* Custom scrollbar for chat */
#chatContainer::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* Message styling */
.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

.message.user {
    margin-left: auto;
    background-color: #e0e7ff;
    border-bottom-right-radius: 0.25rem;
}

.message.tutor {
    margin-right: auto;
    background-color: #f3f4f6;
    border-bottom-left-radius: 0.25rem;
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f3f4f6;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #6b7280;
    border-radius: 50%;
    display: inline-block;
    margin: 0 1px;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1.0);
    }
}

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

/* Feedback highlights */
.feedback-positive {
    color: #10b981;
    border-left: 3px solid #10b981;
    padding-left: 0.5rem;
    margin: 0.5rem 0;
}

.feedback-suggestion {
    color: #f59e0b;
    border-left: 3px solid #f59e0b;
    padding-left: 0.5rem;
    margin: 0.5rem 0;
}

.feedback-correction {
    color: #ef4444;
    border-left: 3px solid #ef4444;
    padding-left: 0.5rem;
    margin: 0.5rem 0;
    text-decoration: line-through;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .message {
        max-width: 90%;
    }
    
    main {
        grid-template-columns: 1fr;
    }
    
    #userInput {
        font-size: 1rem;
    }
}

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

button:active {
    transform: scale(0.98);
}

/* Goal list styling */
#goalsList li {
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

#goalsList li:hover {
    background-color: #f9fafb;
}

#goalsList input[type="checkbox"]:checked + span {
    color: #9ca3af;
    text-decoration: line-through;
}

/* Modal animation */
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#goalModal {
    animation: modalFadeIn 0.3s ease-out;
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

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

/* Tooltip for feedback */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted #666;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

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