/* Custom Styles for Techcloud FAQ Chatbot */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-user {
    animation: slideInRight 0.3s ease-out;
}

.message-assistant {
    animation: slideInLeft 0.3s ease-out;
}

/* Typing indicator animation */
@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
}

/* Code block styling */
.message-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.message-content code {
    background: #f1f5f9;
    color: #475569;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

.message-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Link styling in messages */
.message-content a {
    color: #0ea5e9;
    text-decoration: underline;
}

.message-content a:hover {
    color: #0284c7;
}

/* List styling in messages */
.message-content ul,
.message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
}

/* Table styling in messages */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
}

.message-content th,
.message-content td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    text-align: left;
}

.message-content th {
    background: #f8fafc;
    font-weight: 600;
}

/* Context sources styling */
.context-source {
    transition: all 0.2s ease;
}

.context-source:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Audio player styling */
.audio-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Voice recording button states */
#voice-record-btn.recording {
    background: #fee2e2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Message input auto-resize */
#message-input {
    min-height: 48px;
    overflow-y: hidden;
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Connection status indicator */
.connection-status-online {
    background: #10b981;
}

.connection-status-offline {
    background: #ef4444;
}

.connection-status-connecting {
    background: #f59e0b;
}

/* Tooltip */
[title] {
    position: relative;
}

/* Focus states */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* Disabled states */
button:disabled {
    cursor: not-allowed;
}

/* Modal backdrop */
#settings-modal,
#loading-overlay {
    backdrop-filter: blur(4px);
}

/* Print styles */
@media print {
    header,
    footer,
    #chat-form,
    #settings-btn,
    #voice-toggle {
        display: none;
    }

    #messages-container {
        overflow: visible;
        height: auto;
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .quick-action-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    #message-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .message-user {
        border: 2px solid #0369a1;
    }

    .message-assistant {
        border: 2px solid #64748b;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    /*
    Add dark mode styles here if needed
    Currently using light theme only
    */
}