/* Link2Route Optimizer - Custom CSS */

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

html, body {
    color-scheme: light;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Background pattern for welcome screen */
.bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Enhanced animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.6); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Welcome screen enhancements */
.welcome-logo {
    animation: float 3s ease-in-out infinite, glow 2s ease-in-out infinite alternate;
}

.feature-card {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Main app animations */
.app-container {
    animation: slideIn 0.5s ease-out;
}

/* Stop item animations */
.stop-item {
    animation: slideIn 0.3s ease-out;
    transition: all 0.2s ease;
}

.stop-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Button enhancements */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Notification styles */
.notification {
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
}

.notification.success {
    border-left-color: #10b981;
    background-color: #d1fae5;
    color: #065f46;
}

.notification.error {
    border-left-color: #ef4444;
    background-color: #fee2e2;
    color: #991b1b;
}

.notification.warning {
    border-left-color: #f59e0b;
    background-color: #fef3c7;
    color: #92400e;
}

/* File upload area */
.file-upload-area {
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.file-upload-area.dragover {
    border-color: #1d4ed8;
    background-color: #dbeafe;
    transform: scale(1.02);
}

/* Loading states */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stop list enhancements */
.stops-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.stops-container::-webkit-scrollbar {
    width: 6px;
}

.stops-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.stops-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.stops-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Stop reorder buttons */
.reorder-btn {
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.reorder-btn:hover:not(:disabled) {
    background-color: #3b82f6;
    color: white;
    transform: scale(1.1);
}

.reorder-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Input focus enhancements */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* App selection descriptions */
.app-description {
    transition: all 0.3s ease;
}

.app-description p {
    animation: fadeIn 0.3s ease;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1.25rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stop-item {
        padding: 0.75rem;
    }
    
    .app-container {
        margin: 0.5rem;
    }
}

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

/* Focus visible for keyboard navigation */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gradient-to-br {
        background: #000 !important;
        color: #fff !important;
    }
    
    .bg-white {
        background: #fff !important;
        border: 2px solid #000 !important;
    }
}

/* Dark mode support (disabled) */
@media (prefers-color-scheme: dark) {
    .app-container {
        background-color: #f8fafc;
        color: #1f2937;
    }
    
    .bg-white {
        background-color: #ffffff !important;
        color: #1f2937 !important;
    }
    
    input, textarea, select {
        background-color: #ffffff;
        color: #1f2937;
        border-color: #e5e7eb;
    }
}

/* Print styles */
@media print {
    .welcome-screen,
    .bg-gradient-to-br {
        display: none !important;
    }
    
    .app-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    button {
        display: none;
    }
}