/* ==========================================================================
   Ferry Schedule Styles - Modern Bootstrap 5 Compatible
   ========================================================================== */

/* Filter Bar - Lightweight Design */
.filter-bar {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Date Display Button */
.date-display-wrapper {
    min-width: 160px;
}

.date-display-btn {
    white-space: nowrap;
    min-width: 160px;
    border: 1px solid var(--bs-gray-300);
    background: white;
    transition: all 0.2s ease;
}

.date-display-btn:hover {
    background: var(--bs-gray-100);
    border-color: var(--bs-primary);
}

.date-display-btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(52, 80, 156, 0.25);
    border-color: var(--bs-primary);
}

.date-display-btn i {
    color: var(--bs-primary);
}

/* Direction Pills */
.direction-pills {
    display: inline-flex;
    white-space: nowrap;
}

.direction-pills .btn {
    border-width: 1px;
    min-width: 85px;
}

.direction-pills .btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, var(--bs-primary, #34509c) 0%, #2c447f 100%);
    border-color: var(--bs-primary);
    color: white;
}

.direction-pills .rounded-start {
    border-radius: 20px 0 0 20px !important;
}

.direction-pills .rounded-end {
    border-radius: 0 20px 20px 0 !important;
}

.direction-pills .border-start-0 {
    border-left-width: 0 !important;
}

/* Button Sizing */
.filter-bar .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Mobile Optimization for Filter Bar */
@media (max-width: 575.98px) {
    .filter-bar {
        padding: 0.75rem !important;
    }
    
    .date-display-wrapper {
        min-width: 140px;
        flex: 1;
    }
    
    .date-display-btn {
        min-width: 140px;
        width: 100%;
        font-size: 0.875rem;
    }
    
    .direction-pills {
        width: 100%;
        justify-content: center;
    }
    
    .direction-pills .btn {
        flex: 1;
        max-width: 120px;
    }
    
    .filter-bar .btn-sm {
        padding: 0.325rem 0.5rem;
    }
}

/* Tablet Optimization */
@media (min-width: 576px) and (max-width: 767.98px) {
    .date-display-btn {
        min-width: 150px;
    }
}

/* Schedule Card Styles */
.schedule-card {
    border: 1px solid var(--bs-gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--bs-gray-300);
}

/* Card Header - Light Elegant Design */
.schedule-card .card-header {
    background: var(--bs-gray-100);
    border-bottom: 2px solid var(--bs-primary);
    padding: 1rem 1.25rem;
}

/* Alternative with gradient accent */
.schedule-card .card-header.bg-light {
    background: linear-gradient(to right, var(--bs-light) 0%, white 100%);
    position: relative;
}

.schedule-card .card-header.bg-light::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-accent, #ea1f63) 100%);
}

/* Route Title - Clean and Elegant */
.route-title {
    display: inline-flex;
    align-items: center;
    font-size: 1.125rem;
    color: var(--bs-primary);
    letter-spacing: 0.01em;
}

.route-title i.bi-arrow-right {
    color: var(--bs-gray-500);
    font-size: 0.9em;
}

.route-title i.bi-circle-fill,
.route-title i.bi-circle {
    color: var(--bs-primary);
    opacity: 0.6;
}

/* Date text under route */
.card-header .formatted-date {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    display: inline-block;
    color: var(--bs-gray-600);
}

/* Navigation buttons */
.card-header .btn-outline-primary {
    border-color: var(--bs-gray-300);
    color: var(--bs-primary);
    background: white;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.card-header .btn-outline-primary:hover:not(:disabled) {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    transform: scale(1.05);
}

.card-header .btn-outline-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bs-gray-100);
}

.card-header .btn-group {
    border-radius: 0.375rem;
}

/* Schedule Table */
.table-schedule {
    margin-bottom: 0;
}

.table-schedule thead th {
    background: var(--bs-gray-100);
    color: var(--bs-dark);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--bs-gray-300);
    padding: 1rem;
}

.table-schedule tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    font-size: 0.95rem;
}

.table-schedule tbody tr {
    transition: background-color 0.15s ease;
}

.table-schedule tbody tr:hover {
    background-color: rgba(52, 80, 156, 0.05);
}

/* Time Display */
.time-display {
    font-weight: 600;
    color: var(--bs-dark);
    font-size: 1.05rem;
}

/* Ship Name */
.ship-name {
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

/* Loading State */
.schedule-container {
    min-height: 200px;
    position: relative;
}

.schedule-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Empty State */
.schedule-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--bs-secondary);
}

.schedule-empty i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Next Available */
.next-available {
    background: var(--bs-light);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    display: inline-block;
}

.next-available-date {
    color: var(--bs-primary);
    font-weight: 600;
}

/* Booking Button - Accent Style */
.btn-book {
    background: linear-gradient(135deg, var(--bs-accent, #ea1f63) 0%, #d41b59 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.375rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-book:hover {
    background: linear-gradient(135deg, #d41b59 0%, #c81953 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 31, 99, 0.3);
}

.btn-book i {
    font-size: 0.875em;
}

/* Pagination Controls */
.schedule-pagination {
    background: var(--bs-gray-100);
    border-top: 1px solid var(--bs-gray-200);
}

.schedule-pagination td {
    padding: 1rem !important;
}

.pagination-info {
    color: var(--bs-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 767.98px) {
    /* Smaller route title on mobile */
    .route-title {
        font-size: 1rem;
    }
    
    /* Hide ship column on mobile */
    .ship-column {
        display: none;
    }
    
    /* Compact table on mobile */
    .table-schedule thead th,
    .table-schedule tbody td {
        padding: 0.625rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Full width booking button on mobile */
    .btn-book {
        width: 100%;
        justify-content: center;
    }
    
    /* Smaller navigation buttons */
    .btn-group .btn-sm {
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 575.98px) {
    /* Even more compact on extra small screens */
    .time-display {
        font-size: 0.95rem;
    }
    
    .schedule-card {
        border-radius: 0.5rem;
    }
    
    /* Stack date navigation buttons */
    .card-header .btn-group {
        display: flex;
        gap: 0.25rem;
    }
}

/* Tablet Optimization */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Schedule cards take full width on tablets */
    .schedule-card {
        margin-bottom: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .filter-card,
    .btn-group,
    .schedule-pagination {
        display: none !important;
    }
    
    .schedule-card {
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* Accessibility */
.btn:focus-visible,
.form-control:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Animation for loading spinner */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.schedule-container > * {
    animation: fadeIn 0.3s ease;
}

/* Custom scrollbar for schedule container */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-gray-400) var(--bs-gray-100);
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bs-gray-100);
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--bs-gray-400);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: var(--bs-gray-500);
}