/* TECCON Fuel Management - Flask Frontend Styles */

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Base styles */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: #10b981;
}

.status-offline {
    background-color: #ef4444;
}

.status-warning {
    background-color: #f59e0b;
}

/* Progress bars */
.progress-bar {
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 9999px;
}

.progress-green { background-color: #10b981; }
.progress-yellow { background-color: #f59e0b; }
.progress-red { background-color: #ef4444; }
.progress-blue { background-color: #3b82f6; }

/* Table styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-striped tbody tr:nth-child(odd) {
    background-color: #f9fafb;
}

.table-hover tbody tr:hover {
    background-color: #f3f4f6;
}

/* Form styles */
.form-input {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-error {
    border-color: #ef4444;
}

.form-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-stack {
        flex-direction: column;
    }
    
    /* Mobile-specific improvements */
    .mobile-padding {
        padding: 1rem;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem;
    }
    
    .mobile-spacing {
        margin-bottom: 1rem;
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better table scrolling on mobile */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    /* Mobile navigation improvements */
    nav {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Form improvements for mobile */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Tablet specific styles */
@media (min-width: 641px) and (max-width: 1024px) {
    .tablet-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tablet-spacing {
        gap: 1.5rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1280px) {
    .xl-container {
        max-width: 1400px;
    }
    
    .xl-grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-full-width {
        width: 100% !important;
    }
    
    body {
        font-size: 12px;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* Custom utilities */
.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(4px);
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 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; }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
}

/* Enhanced hamburger button styles */
.hamburger-button {
    position: relative;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px) scale(1.05);
}

.hamburger-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

/* Hamburger icon animation */
.hamburger-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-icon:hover {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

/* Pulse animation for attention */
@keyframes hamburger-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(59, 130, 246, 0.8);
    }
}

.hamburger-pulse {
    animation: hamburger-pulse 2s ease-in-out infinite;
}

/* Mobile menu enhanced styles */
.mobile-menu-enhanced {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 1rem 1rem;
}

.mobile-menu-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s;
}

.mobile-menu-item:hover::before {
    left: 100%;
}

.mobile-menu-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Menu label animation */
.menu-label {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Notification dot animation */
@keyframes notification-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.notification-dot {
    animation: notification-pulse 2s ease-in-out infinite;
}

/* Enhanced mobile styles */
@media (max-width: 767px) {
    /* Enhanced mobile hamburger button */
    .hamburger-button {
        padding: 0.875rem;
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
        min-width: 48px;
        min-height: 48px;
    }
    
    .menu-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #374151;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    /* Mobile menu improvements */
    #mobile-menu {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
    
    /* Better touch targets */
    #mobile-menu a {
        min-height: 56px;
        display: flex;
        align-items: center;
    }
}

/* Icon color variations for menu items */
.icon-blue { color: #3b82f6; }
.icon-green { color: #10b981; }
.icon-yellow { color: #f59e0b; }
.icon-purple { color: #8b5cf6; }
.icon-indigo { color: #6366f1; }
.icon-gray { color: #6b7280; }

/* Smooth transitions for all interactive elements */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a, input, select, textarea {
    transition: all 0.2s ease-in-out;
}

/* Enhanced focus states for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Improved mobile navigation experience */
@media (max-width: 767px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Better spacing for mobile */
    .mobile-nav-spacing {
        padding: 0.5rem 1rem;
    }
    
    /* Enhanced touch feedback */
    .touch-feedback:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}