/* Main stylesheet */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
}

/* Dark theme */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #ffffff;
    --bs-border-color: #444444;
}

/* Chat specific styles */
.chat-container {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bs-body-bg);
}

.message {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 80%;
    position: relative;
    animation: fadeIn 0.3s ease-in;
}

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

.user-message {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}

.ai-message {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    margin-right: auto;
    border-bottom-left-radius: 0.25rem;
}

.message-timestamp {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.igala-badge {
    background: var(--success-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Image grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.image-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-4px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover img {
    transform: scale(1.05);
}

/* Usage meters */
.usage-meter {
    height: 0.5rem;
    background: var(--bs-secondary-bg);
    border-radius: 1rem;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.3s ease;
}

/* Loading animations */
.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid var(--bs-secondary-bg);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 160px);
    }
    
    .message {
        max-width: 90%;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .chat-messages {
        overflow: visible;
        height: auto;
    }
}