/* Global styles for Dog Personal Assistant */

:root {
    --primary-color: #1976d2;
    --secondary-color: #388e3c;
    --accent-color: #f57c00;
    --error-color: #d32f2f;
    --warning-color: #ffa726;
    --info-color: #0288d1;
    --success-color: #388e3c;
    
    --background-color: #ffffff;
    --surface-color: #f5f5f5;
    --text-primary: #212121;
    --text-secondary: #757575;
    --divider-color: #e0e0e0;
    
    --border-radius: 8px;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 16px rgba(0,0,0,0.2);
    
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dark theme */
[data-theme="dark"] {
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --divider-color: #333333;
}

/* Base typography */
body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--background-color);
    line-height: 1.6;
}

/* Enhanced chart containers */
.chart-container {
    background: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: 24px;
    margin: 16px 0;
    transition: box-shadow 0.3s ease;
}

.chart-container:hover {
    box-shadow: var(--shadow-medium);
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
}

/* Enhanced MudBlazor chart styling */
.mud-chart {
    background: transparent !important;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.mud-chart canvas {
    border-radius: var(--border-radius) !important;
    transition: transform 0.3s ease;
}

.mud-chart:hover canvas {
    transform: scale(1.02);
}

/* Donut chart specific styling */
.donut-chart {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.donut-chart canvas {
    height: 100% !important;
    width: 100% !important;
    border-radius: var(--border-radius);
}

.donut-chart.small {
    height: 200px !important;
}

/* Statistics cards */
.stats-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.stats-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stats-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stats-card-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Enhanced tables */
.enhanced-table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.enhanced-table .mud-table-head {
    background: var(--primary-color);
}

.enhanced-table .mud-table-head .mud-table-cell {
    color: white;
    font-weight: 600;
}

.enhanced-table .mud-table-row:nth-child(even) {
    background-color: var(--surface-color);
}

.enhanced-table .mud-table-row:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Loading animations */
.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--surface-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced alerts */
.custom-alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-light);
    margin: 16px 0;
}

.custom-alert.info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--info-color);
}

.custom-alert.success {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-left: 4px solid var(--success-color);
}

.custom-alert.warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid var(--warning-color);
}

.custom-alert.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 4px solid var(--error-color);
}

/* Improved buttons */
.btn-enhanced {
    border-radius: var(--border-radius);
    font-weight: 600;
    text-transform: none;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-enhanced:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.6s, height 0.6s, top 0.6s, left 0.6s;
    z-index: 0;
}

.btn-enhanced:active:before {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
}

/* Enhanced paper components */
.enhanced-paper {
    background: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--divider-color);
}

.enhanced-paper:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .chart-container {
        padding: 12px;
        margin: 8px 0;
    }
    
    .stats-card {
        padding: 12px;
    }
    
    .stats-card-value {
        font-size: 1.25rem;
    }
    
    /* Mobile-specific container adjustments */
    .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* Typography adjustments for mobile */
    .mud-typography-h3 {
        font-size: 1.5rem !important;
    }
    
    .mud-typography-h4 {
        font-size: 1.25rem !important;
    }
    
    .mud-typography-h5 {
        font-size: 1.1rem !important;
    }
    
    .mud-typography-h6 {
        font-size: 1rem !important;
    }
    
    /* Chart responsive adjustments */
    .mud-chart {
        min-height: 200px !important;
        height: 240px !important;
    }
    
    /* Enhanced paper mobile adjustments */
    .enhanced-paper {
        padding: 12px !important;
        margin: 8px 0 !important;
    }
    
    /* Navigation improvements for mobile */
    .mud-drawer {
        width: 260px !important;
    }
    
    .mud-drawer-mini {
        width: 60px !important;
    }
    
    /* App bar mobile adjustments */
    .enhanced-app-bar {
        padding: 0 8px !important;
    }
    
    .app-title {
        font-size: 1.1rem !important;
    }
    
    /* Calendar mobile improvements */
    .calendar-grid {
        gap: 4px !important;
    }
    
    .calendar-cell {
        padding: 8px !important;
        min-height: 100px !important;
    }
    
    .calendar-header-cell {
        padding: 8px 4px !important;
        font-size: 0.8rem !important;
    }
    
    /* Button improvements for touch */
    .mud-button {
        min-height: 44px !important;
        padding: 8px 16px !important;
    }
    
    .mud-icon-button {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    .enhanced-paper {
        padding: 8px !important;
        margin: 4px 0 !important;
    }
    
    .chart-container {
        padding: 8px;
        margin: 4px 0;
    }
    
    .stats-card {
        padding: 8px;
        margin: 4px 0;
    }
    
    .stats-card-value {
        font-size: 1.1rem;
    }
    
    /* Typography for very small screens */
    .mud-typography-h3 {
        font-size: 1.25rem !important;
    }
    
    .mud-typography-h4 {
        font-size: 1.1rem !important;
    }
    
    /* Calendar adjustments for small screens */
    .calendar-cell {
        padding: 4px !important;
        min-height: 80px !important;
    }
    
    .calendar-header-cell {
        padding: 6px 2px !important;
        font-size: 0.75rem !important;
    }
    
    .calendar-day-number {
        font-size: 0.9rem !important;
    }
    
    .calories-badge {
        font-size: 0.7rem !important;
        padding: 2px 4px !important;
    }
    
    .nutrient-item {
        font-size: 0.6rem !important;
        padding: 1px 3px !important;
    }
    
    /* App title hiding on very small screens */
    .app-title {
        display: none !important;
    }
    
    /* Compact navigation for small screens */
    .nav-link-content small {
        display: none;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .calendar-cell {
        min-height: 90px !important;
    }
    
    .mud-chart {
        height: 220px !important;
    }
}

/* Touch-specific improvements */
@media (pointer: coarse) {
    .mud-button,
    .mud-icon-button,
    .calendar-cell,
    .nav-item {
        min-height: 44px;
    }
    
    .mud-input .mud-input-control {
        min-height: 44px;
    }
    
    /* Increase spacing for better touch targets */
    .mud-stack.spacing-2 > * + * {
        margin-top: 12px !important;
        margin-left: 12px !important;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mud-chart svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.mud-button:focus,
.mud-input:focus,
.mud-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Print styles */
@media print {
    .chart-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn-enhanced,
    .mud-button {
        display: none;
    }
}

/* Keyframe animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Enhanced hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced focus styles for accessibility */
.mud-button:focus,
.mud-input:focus,
.mud-select:focus,
.mud-nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.1);
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
