/* Modern Light Theme Styles */

:root {
    /* Colors inspired by modern UI design */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Brand colors */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    
    /* Accent colors */
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-200: #e9d5ff;
    --purple-300: #d8b4fe;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    --purple-700: #7c3aed;
    
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-300: #86efac;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-300: #fca5a5;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* Global styles */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

code, pre, .font-mono {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

body {
    color: var(--gray-900);
    background-color: var(--gray-50);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 6px;
    border: 3px solid var(--gray-100);
}

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

/* Time Machine styles */
.time-machine {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.time-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    outline: none;
    transition: all 0.2s ease;
}

.time-slider:hover {
    background: var(--gray-300);
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-500);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--primary-100);
    transition: all 0.2s ease;
}

.time-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px var(--white), 0 0 0 8px var(--primary-100);
}

/* Enhanced Time Slider */
.time-slider-enhanced {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    background: transparent;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.time-slider-enhanced::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 
        0 0 0 4px var(--white), 
        0 0 0 6px var(--primary-200),
        0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--white);
    position: relative;
}

.time-slider-enhanced::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 0 0 4px var(--white), 
        0 0 0 8px var(--primary-200),
        0 6px 20px rgba(59, 130, 246, 0.4);
    cursor: grab;
}

.time-slider-enhanced::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 
        0 0 0 4px var(--white), 
        0 0 0 10px var(--primary-300),
        0 2px 8px rgba(59, 130, 246, 0.5);
}

.time-slider-enhanced::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: 50%;
    cursor: grab;
    border: 2px solid var(--white);
    box-shadow: 
        0 0 0 4px var(--primary-200),
        0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-slider-enhanced::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 0 0 6px var(--primary-200),
        0 6px 20px rgba(59, 130, 246, 0.4);
}

.slider-track-bg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-300) 100%);
    border-radius: 4px;
    transform: translateY(-50%);
    z-index: 1;
}

.slider-track-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-400) 0%, var(--primary-600) 100%);
    border-radius: 4px;
    transform: translateY(-50%);
    z-index: 2;
    transition: width 0.2s ease;
}

.slider-labels {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    pointer-events: none;
    padding: 0 20px;
    z-index: 20;
}

.slider-label-start,
.slider-label-end {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
    background: var(--white);
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-200);
}

/* Button styles */
.btn-primary {
    background: var(--primary-500);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Search input */
.search-input {
    background: var(--white);
    border: 1px solid var(--gray-300);
    transition: all 0.2s ease;
    font-size: 14px;
}

.search-input:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Commit card styles */
.commit-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.commit-card:hover {
    border-color: var(--primary-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* AI Badge */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ai-badge-high {
    background: var(--purple-100);
    color: var(--purple-700);
    border: 1px solid var(--purple-200);
}

.ai-badge-medium {
    background: var(--primary-100);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
}

.ai-badge-low {
    background: var(--green-100);
    color: var(--green-700);
    border: 1px solid var(--green-200);
}

.ai-badge-none {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

/* Progress bars */
.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.progress-bar-purple {
    background: linear-gradient(90deg, var(--purple-400) 0%, var(--purple-600) 100%);
}

.progress-bar-blue {
    background: linear-gradient(90deg, var(--primary-400) 0%, var(--primary-600) 100%);
}

.progress-bar-green {
    background: linear-gradient(90deg, var(--green-400) 0%, var(--green-600) 100%);
}

.progress-bar-gray {
    background: var(--gray-400);
}

/* Stat cards */
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Modal styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 40;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--purple-50) 100%);
    border-bottom: 1px solid var(--gray-200);
    padding: 32px;
}

/* Code block styling */
.code-block {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    overflow-x: auto;
}

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

.badge-yellow {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-cyan {
    background: #cffafe;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

.badge-purple {
    background: var(--purple-100);
    color: var(--purple-700);
    border: 1px solid var(--purple-200);
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Section dividers */
.section-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 24px 0;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .time-machine {
        padding: 20px;
    }
    
    .commit-card {
        padding: 20px;
    }
    
    .modal-header {
        padding: 24px;
    }
    
    /* Stack time machine controls on mobile */
    .time-machine .flex-wrap-mobile {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Full width search on mobile */
    header .flex {
        flex-wrap: wrap;
    }
    
    header .flex-1 {
        width: 100%;
        margin-top: 0.75rem;
    }
}

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

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

/* Chart styles - Cool and animated */
.charts-overview {
    background: linear-gradient(135deg, var(--white) 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.charts-overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--purple-500), var(--green-500));
    border-radius: 20px 20px 0 0;
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
    transition: left 0.6s ease;
}

.chart-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-300);
}

.chart-card-hover:hover::before {
    left: 100%;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chart-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
}

.chart-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.chart-container {
    height: 140px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 8px 0;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 100%;
    width: 100%;
    justify-content: space-around;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 36px;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 2px 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-bar-animated {
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-bar:hover {
    transform: scaleY(1.05) scaleX(1.1);
    filter: brightness(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chart-bar-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: inherit;
    border-radius: inherit;
    filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.chart-bar:hover .chart-bar-glow {
    opacity: 0.3;
}

.chart-bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-700);
    background: var(--white);
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.chart-bar:hover .chart-bar-value {
    opacity: 1;
}

.chart-bar-blue {
    background: linear-gradient(180deg, #60a5fa 0%, var(--primary-600) 50%, var(--primary-700) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.chart-bar-purple {
    background: linear-gradient(180deg, #c084fc 0%, var(--purple-600) 50%, var(--purple-700) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.chart-bar-green {
    background: linear-gradient(180deg, #4ade80 0%, var(--green-600) 50%, #15803d 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.chart-bar-red {
    background: linear-gradient(180deg, #f87171 0%, var(--red-600) 50%, #dc2626 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.chart-bar-stack {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: 1px;
    position: relative;
}

.chart-bar-stack .chart-bar {
    border-radius: 3px;
}

.chart-bar-stack .chart-bar:first-child {
    border-radius: 6px 6px 3px 3px;
}

.chart-bar-stack .chart-bar:last-child {
    border-radius: 3px 3px 2px 2px;
}

.chart-label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    text-align: center;
    transition: color 0.3s ease;
}

.chart-bar-group:hover .chart-label {
    color: var(--gray-700);
}

/* Pulsing animation for empty data */
@keyframes pulse-glow {
    0%, 100% { 
        opacity: 0.4;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.02);
    }
}

.chart-bar[style*="4px"], .chart-bar[style*="2px"] {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Responsive chart adjustments */
@media (max-width: 768px) {
    .charts-overview {
        padding: 20px;
    }
    
    .chart-container {
        height: 100px;
    }
    
    .chart-bars {
        gap: 4px;
    }
    
    .chart-bar-group {
        max-width: 30px;
    }
    
    .chart-label {
        font-size: 10px;
    }
}

/* Focus styles */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}