/* Custom CSS for FindFerries - Production-ready styling enhancements */

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s;
}

.skip-link:focus {
    transform: translateY(0%);
}

/* Enhanced button styling */
.btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition-all duration-200 transform hover:scale-105 shadow-lg;
}

.btn-secondary {
    @apply bg-gray-600 hover:bg-gray-700 text-white font-semibold py-2 px-4 rounded-lg transition-colors duration-200;
}

/* Form enhancements */
.form-input {
    @apply w-full border-2 border-gray-300 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 transition-colors duration-200;
}

.form-select {
    @apply w-full border-2 border-gray-300 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white transition-colors duration-200;
}

.form-checkbox {
    @apply rounded border-gray-300 text-blue-600 focus:ring-blue-500 focus:ring-2;
}

/* Loading states */
.loading-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); }
}

/* Progress bar animations */
.progress-bar {
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    transition: width 0.3s ease-in-out;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    max-width: 24rem;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification-success {
    @apply bg-green-500 text-white;
}

.notification-warning {
    @apply bg-yellow-500 text-white;
}

.notification-error {
    @apply bg-red-500 text-white;
}

.notification-info {
    @apply bg-blue-500 text-white;
}

/* Enhanced card hover effects */
.card-hover {
    transition: all 0.3s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Feature filter button states */
.feature-filter {
    transition: all 0.2s ease-in-out;
}

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

.feature-filter.active {
    @apply bg-blue-100 border-blue-400 text-blue-800;
}

/* Company card enhancements */
.company-card {
    transition: all 0.3s ease-in-out;
    border: 2px solid transparent;
}

.company-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.15);
}

.company-card.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Star rating styling */
.star-rating {
    display: flex;
    align-items: center;
}

.star-rating svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.125rem;
}

/* Route preview styling */
.route-preview {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    animation: slideIn 0.3s ease-out;
}

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

/* Advanced search enhancements */
.search-input-wrapper {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 240px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-top: 0.25rem;
}

.search-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease-in-out;
}

.search-dropdown-item:hover {
    background-color: #f9fafb;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

/* Responsive table styling */
.responsive-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.responsive-table table {
    min-width: 600px;
}

/* Enhanced modal styling */
.modal-overlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    animation: slideInUp 0.3s ease-out;
}

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

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

/* Price display styling */
.price-display {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: bold;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.price-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.price-amount {
    font-size: 1.5rem;
    line-height: 1.2;
}

/* Comparison table enhancements */
.comparison-table {
    border-collapse: collapse;
    width: 100%;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
}

.comparison-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.comparison-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Feature badge styling */
.feature-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background-color: #dbeafe;
    color: #1e40af;
}

.feature-badge.available {
    background-color: #dcfce7;
    color: #166534;
}

.feature-badge.unavailable {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Loading states for dynamic content */
.content-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.content-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

/* Enhanced navigation styling */
.nav-link {
    position: relative;
    transition: color 0.2s ease-in-out;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #93c5fd;
    transition: width 0.2s ease-in-out;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown menu enhancements */
.dropdown-menu {
    transition: all 0.2s ease-in-out;
    transform: translateY(-10px);
}

.dropdown-menu.visible {
    transform: translateY(0);
}

/* Accessibility improvements */
.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 for better keyboard navigation */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    body {
        color: black;
        background: white;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .comparison-table th,
    .comparison-table td {
        border: 2px solid #000;
    }
    
    .feature-badge {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here if implemented */
}

/* Custom scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Additional utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Section spacing utility */
.section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* Container max-width adjustments */
.container {
    max-width: 1200px;
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Image aspect ratio utilities */
.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-ratio-square {
    aspect-ratio: 1 / 1;
}

/* Enhanced typography */
.text-balance {
    text-wrap: balance;
}

/* Grid enhancements */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Flexible layout utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideInUp 0.5s ease-out;
}

.animate-pulse-subtle {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}