/*
 * ASSET Copilot - Custom Styles
 *
 * This file contains custom CSS overrides and additions.
 * Colors can be easily changed by modifying the CSS variables below.
 */

/* =============================================================================
   Theme Variables (Easy to customize)
   ============================================================================= */

:root {
    /* Primary Colors - Emerald (Warm & Friendly) */
    --color-primary: #10B981;
    --color-primary-dark: #059669;
    --color-primary-light: #34D399;
    --color-primary-50: #ECFDF5;
    --color-primary-100: #D1FAE5;

    /* Secondary Colors - Warm Amber */
    --color-secondary: #F59E0B;
    --color-secondary-dark: #D97706;
    --color-secondary-light: #FBBF24;

    /* Accent - Teal */
    --color-accent: #14B8A6;

    /* Semantic Colors */
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* Warm Neutral Base (Stone palette instead of cold gray) */
    --color-neutral: #44403C;
    --color-neutral-light: #78716C;
    --color-base-50: #FAFAF9;
    --color-base-100: #FFFFFF;
    --color-base-200: #F5F5F4;
    --color-base-300: #E7E5E4;

    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* =============================================================================
   Typography Enhancements
   ============================================================================= */

body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   Chat Components
   ============================================================================= */

/* Chat bubble hover effect */
.chat-bubble {
    transition: transform 0.15s ease;
}

/* Markdown content in chat */
.chat-bubble .prose {
    font-size: 0.875rem;
    line-height: 1.6;
}

.chat-bubble .prose pre {
    background-color: var(--color-base-200);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    overflow-x: auto;
}

.chat-bubble .prose code {
    background-color: var(--color-base-200);
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.8em;
}

.chat-bubble .prose pre code {
    background-color: transparent;
    padding: 0;
}

/* Chat input auto-resize */
.chat-input textarea {
    field-sizing: content;
    min-height: 2.5rem;
}

/* =============================================================================
   Card Enhancements
   ============================================================================= */

/* Stat card hover */
.stat {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

/* Insight card bullet points */
.insight-bullet {
    position: relative;
    padding-left: 1rem;
}

.insight-bullet::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.375rem;
    height: 0.375rem;
    background-color: currentColor;
    border-radius: 50%;
    opacity: 0.5;
}

/* =============================================================================
   Sidebar Enhancements
   ============================================================================= */

/* Active menu item with left border indicator - Emerald gradient */
.nav-item-active {
    background: linear-gradient(135deg, var(--color-primary-50), var(--color-primary-100));
    color: var(--color-primary-dark);
    font-weight: 500;
    position: relative;
    border-radius: 0.5rem;
}

.nav-item-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: var(--color-primary);
    border-radius: 0 4px 4px 0;
}

/* Legacy active menu item */
.menu a.active,
.menu li > a.active {
    background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: var(--color-primary);
    font-weight: 500;
}

/* Menu item hover */
.menu a:hover {
    background-color: var(--color-base-200);
}

/* =============================================================================
   Sidebar Tooltips (for collapsed state)
   ============================================================================= */

.tooltip-sidebar {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 0.75rem;
    background-color: var(--color-neutral);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

/* Tooltip arrow */
.tooltip-sidebar::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--color-neutral);
}

/* Show tooltip on hover */
.group:hover .tooltip-sidebar {
    opacity: 1;
    visibility: visible;
}

/* =============================================================================
   Table Enhancements
   ============================================================================= */

/* Sortable table header */
.table th.sortable {
    cursor: pointer;
    user-select: none;
}

.table th.sortable:hover {
    background-color: var(--color-base-200);
}

/* Table row hover */
.table tbody tr {
    transition: background-color 0.15s ease;
}

/* =============================================================================
   Chart Container
   ============================================================================= */

.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

.chart-container canvas {
    max-width: 100%;
}

/* =============================================================================
   Loading States
   ============================================================================= */

/* Skeleton loading */
.skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* =============================================================================
   Transitions & Animations
   ============================================================================= */

/* Smooth transitions for interactive elements */
.btn,
.card,
.input,
.select,
.textarea {
    transition: all 0.2s ease;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Slide in from right (for chat messages) */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Slide in from left (for AI responses) */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

/* =============================================================================
   Scrollbar Styling
   ============================================================================= */

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

::-webkit-scrollbar-track {
    background: var(--color-base-200);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--color-base-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--color-neutral) 30%, transparent);
}

/* =============================================================================
   Focus States (Accessibility)
   ============================================================================= */

/* Enhanced focus ring */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .no-print,
    .sidebar,
    .navbar,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* =============================================================================
   Warm & Friendly Theme Enhancements
   ============================================================================= */

/* Warm page background */
.bg-warm {
    background-color: var(--color-base-50);
}

/* Enhanced card styling with warm shadows */
.card {
    border: 1px solid var(--color-base-300);
    box-shadow: 0 1px 3px rgba(68, 64, 60, 0.06), 0 1px 2px rgba(68, 64, 60, 0.04);
}

.card:hover {
    box-shadow: 0 4px 6px rgba(68, 64, 60, 0.07), 0 2px 4px rgba(68, 64, 60, 0.05);
}

/* Primary button with subtle gradient */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-color: var(--color-primary-dark);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), #047857);
}

/* Warm hover states */
.hover\:bg-warm:hover {
    background-color: var(--color-base-200);
}

/* Badge enhancements */
.badge-primary {
    background-color: var(--color-primary-100);
    color: var(--color-primary-dark);
    border-color: var(--color-primary-light);
}

/* Table header with warm background */
.table thead th {
    background-color: var(--color-base-200);
    color: var(--color-neutral);
}

/* Sidebar logo background */
.sidebar-logo {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

/* Stat card value color */
.stat-value-primary {
    color: var(--color-primary);
}

/* Avatar ring */
.avatar-ring-primary {
    ring-color: var(--color-primary-light);
}
