/* Custom styles for Block Beagle */

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

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

#chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#chat-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

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

/* Message animations */
.message-enter {
    animation: slideInUp 0.3s ease-out;
}

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

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

/* Table hover effects */
.table-row:hover {
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Status message transitions */
.status-enter {
    animation: slideInDown 0.3s ease-out;
}

.status-exit {
    animation: slideOutUp 0.3s ease-in;
}

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

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

/* Responsive improvements */
@media (max-width: 640px) {
    /* Ensure touch targets are at least 44x44px */
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
    
    /* Improve text readability on mobile */
    body {
        font-size: 16px;
    }
    
    /* Better table scrolling on mobile */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Adjust padding for mobile */
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Better form inputs on mobile */
    input[type="text"],
    input[type="email"],
    textarea {
        font-size: 16px;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
    #chat-container {
        height: 400px;
    }
}

/* Ensure proper viewport behavior */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Improve scrolling on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Better focus states for touch devices */
@media (hover: none) and (pointer: coarse) {
    button:focus,
    a:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }
}

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

/* Inline edit styles for profile page */

.inline-edit-container {
    position: relative;
}

.inline-edit-display,
.inline-edit-input {
    display: block;
    width: 100%;
    min-height: 2.25rem; /* Matching Tailwind py-2 + line-height */
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5rem;
}

.inline-edit-input {
    border: 1px solid #d1d5db; /* Tailwind gray-300 */
    position: absolute;
    top: 0;
    left: 0;
    background-color: white;
    display: none;
}

.inline-edit-container.editing .inline-edit-display {
    visibility: hidden;
}

.inline-edit-container.editing .inline-edit-input {
    display: block;
}