/* Material-Inspired Styles for Zodiac Copilot */

:root {
    --blue-50: #f0f6ff;
    --blue-100: #e0ecff;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-thumb {
    background: var(--slate-700);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--slate-600);
}

/* Chat Message Styles */
.message-container {
    display: flex;
    gap: 12px;
    margin-bottom: 0px;
    animation: slideUp 0.3s ease-out;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 18px;
}

.message-avatar.user {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: white;
}

.message-avatar.assistant {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.message-avatar.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.message-bubble {
    flex: 1;
}

.message-text {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    overflow-x: auto;
}

.message-text.user {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: white;
    border-radius: 20px 20px 4px 20px;
}

.message-text.assistant {
    background: var(--slate-100);
    color: var(--slate-900);
    border-radius: 20px 20px 20px 4px;
    border: 1px solid var(--slate-200);
}

.dark .message-text.assistant {
    background: var(--slate-800);
    color: var(--slate-100);
    border-color: var(--slate-700);
}

.message-text.error {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 12px;
    border: 1px solid #fecaca;
}

.dark .message-text.error {
    background: #7f1d1d;
    color: #fecaca;
    border-color: #dc2626;
}

.message-time {
    font-size: 12px;
    color: var(--slate-500);
    margin-top: 0px;
    padding: 0 4px;
}

/* Loading indicator */
.loading-container {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.loading-bubble {
    padding: 12px 16px;
    background: var(--slate-100);
    border-radius: 20px;
    border: 1px solid var(--slate-200);
    display: flex;
    gap: 4px;
    align-items: center;
}

.dark .loading-bubble {
    background: var(--slate-800);
    border-color: var(--slate-700);
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--slate-500);
    animation: bounce 1.4s infinite;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        opacity: 0.5;
    }
    40% {
        opacity: 1;
    }
}

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

/* Textarea auto-resize */
textarea {
    overflow: hidden;
    resize: none;
}

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

/* Button hover effects */
button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stat box animations */
.stat-box {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-box:hover {
    transform: translateY(-2px);
}

/* Material elevation classes */
.elevation-1 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.elevation-2 {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.elevation-3 {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.elevation-4 {
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.05);
}

/* Gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Status messages */
.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-info {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #93c5fd;
}

.dark .status-info {
    background: #1e3a8a;
    color: #dbeafe;
    border-color: #1e40af;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.dark .status-error {
    background: #7f1d1d;
    color: #fecaca;
    border-color: #dc2626;
}

.status-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.dark .status-success {
    background: #15803d;
    color: #dcfce7;
    border-color: #4ade80;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: var(--blue-100);
    color: var(--blue-700);
}

.dark .badge-primary {
    background: var(--blue-900);
    color: var(--blue-200);
}

.badge-secondary {
    background: var(--slate-200);
    color: var(--slate-700);
}

.dark .badge-secondary {
    background: var(--slate-700);
    color: var(--slate-300);
}

/* Responsive grid for stats */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Accessibility - High contrast mode */
@media (prefers-contrast: more) {
    .message-text {
        border: 1px solid currentColor;
    }

    button {
        border: 2px solid currentColor;
    }
}

/* Dark mode specific styles */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}
