/* Chitram - AI Image Generator App - Custom Styles */

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

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Hide scrollbar for chat list but keep functionality */
#chatList::-webkit-scrollbar {
    width: 4px;
}

/* Textarea placeholder */
#promptInput::placeholder {
    color: #9ca3af;
}

/* Animation for loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Chat message animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chatMessages > div {
    animation: fadeIn 0.3s ease-out;
}

/* Image preview hover effect */
#imagePreviewList img {
    transition: transform 0.2s ease;
}

#imagePreviewList img:hover {
    transform: scale(1.05);
}

/* Chat image hover effect */
.chat-image {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Sidebar transition for mobile */
#sidebar {
    transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
    #sidebar {
        position: fixed;
        z-index: 40;
        transform: translateX(0);
    }

    #sidebar.-translate-x-full {
        transform: translateX(-100%);
    }
}

/* Chat item active state */
.chat-item.active {
    background-color: #4b5563;
}

/* Button press effect */
button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Modal backdrop blur */
#renameModal,
#imageViewerModal,
#loadingOverlay {
    backdrop-filter: blur(4px);
}

/* Welcome message gradient text */
#welcomeMessage h2 {
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Send button gradient */
#sendBtn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transition: all 0.2s ease;
}

#sendBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Image count badge */
#imageCount {
    font-weight: 600;
    color: #60a5fa;
}

/* Model selector styling */
#modelSelector {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Input focus ring */
#promptInput:focus,
#renameInput:focus,
#modelSelector:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Smooth scroll for messages */
#chatMessages {
    scroll-behavior: smooth;
}

/* Message bubble styles */
#chatMessages .bg-blue-600 {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

#chatMessages .bg-gray-700 {
    background: linear-gradient(135deg, #374151, #1f2937);
}

/* New chat button hover */
#newChatBtn:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
}

/* Error message styling */
#chatMessages .error-message {
    color: #f87171;
    border-left: 3px solid #ef4444;
    padding-left: 12px;
}

/* Loading dots animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-dots span {
    animation: pulse 1.5s ease-in-out infinite;
}

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

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

/* Responsive adjustments */
@media (max-width: 640px) {
    #chatMessages > div > div {
        max-width: 90%;
    }

    .chat-image {
        max-height: 200px;
    }
}

/* Print styles */
@media print {
    #sidebar,
    #imagePreviewArea,
    .border-t,
    button {
        display: none !important;
    }

    #chatMessages {
        overflow: visible;
    }
}
