/* Ferry Schedule Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.page-header {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.title-section {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}


.date-picker {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.date-picker:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.date-picker:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Date picker calendar icon styling */
.date-picker::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
    cursor: pointer;
}

.date-picker::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-links .service-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.header-links .service-link:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-links .timezone {
    font-size: 0.9rem;
    opacity: 0.8;
}

.schedule-container {
    max-width: 1000px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.schedule-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-collapse: collapse;
    border: 1px solid #e1e5e9;
}

.schedule-table thead {
    background: linear-gradient(135deg, #495057, #343a40);
    color: white;
}

.schedule-table th {
    padding: 0.8rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

.schedule-table th:first-child {
    border-top-left-radius: 12px;
}

.schedule-table th:last-child {
    border-top-right-radius: 12px;
}

.time-column {
    width: 25%;
}

.start-column {
    width: 25%;
}

.end-column {
    width: 25%;
}

.service-column {
    width: 25%;
}

.ferry-row {
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.15s ease-in-out;
    background-color: white;
}

.ferry-row:hover {
    background-color: #e9ecef !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Color coding for Chebeague routes */
.ferry-row.to-chebeague {
    background-color: #d4f7d4 !important;
    border-left: 4px solid #28a745;
    border-bottom: 1px solid #f1f3f4 !important;
}

.ferry-row.to-chebeague:hover {
    background-color: #b8e6b8 !important;
}

.ferry-row.from-chebeague {
    background-color: #ffeaa7 !important;
    border-left: 4px solid #e17055;
    border-bottom: 1px solid #f1f3f4 !important;
}

.ferry-row.from-chebeague:hover {
    background-color: #fcc474 !important;
}

.ferry-row:last-child {
    border-bottom: none;
}

.ferry-row:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.ferry-row:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.schedule-table td {
    padding: 0.25rem 1rem;
    vertical-align: middle;
    border-left: 1px solid transparent;
}

.time-cell {
    font-size: 1.2rem;
    font-weight: 700;
    color: #212529;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.service-cell {
    font-weight: 500;
}

.location-cell {
    font-weight: 500;
    color: #495057;
}

.service-name {
    display: inline-block;
    padding: 0.15rem 0.3rem;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-name:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ferry-ctc .service-name {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.ferry-cbl .service-name {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
}

.info-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-link {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    background: white;
}

.service-link:hover {
    background-color: #495057;
    color: white;
    border-color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.timezone {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.no-service {
    text-align: center;
    background: white;
    padding: 4rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.no-service h3 {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.no-service p {
    font-size: 1.2rem;
    color: #9ca3af;
}

/* Filter buttons */
.filter-buttons {
    display: flex;
    gap: 0.4rem;
}

.filter-btn {
    display: inline-block;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    color: white;
}

.filter-btn:active {
    transform: translateY(0);
}

.page-footer {
    background: #f3f4f6;
    border-top: 1px solid #e5e7eb;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 4rem;
}

.page-footer p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        padding: 0.75rem;
    }
    
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    
    .title-section {
        gap: 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    
    .date-picker {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
    
    .header-links {
        flex-wrap: wrap;
        gap: 0.4rem;
        width: 100%;
    }
    
    .schedule-container {
        margin: 0.75rem auto;
        padding: 0 0.75rem;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .time-cell {
        font-size: 1rem;
    }
    
    .filter-buttons {
        gap: 0.3rem;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 0.5rem;
    }
    
    .title-section {
        gap: 0.5rem;
    }
    
    .page-header h1 {
        font-size: 1.2rem;
    }
    
    
    .schedule-container {
        margin: 0.5rem auto;
        padding: 0 0.5rem;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.85rem;
    }
    
    .time-cell {
        font-size: 0.9rem;
    }
    
    .service-name {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .service-link {
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
    }
    
    .date-picker {
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .filter-btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
}

/* Index page styles */
.date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.date-link {
    display: block;
    padding: 1.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.date-link:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #212529;
}

@media (max-width: 768px) {
    .date-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .date-link {
        padding: 1rem;
        font-size: 0.9rem;
    }
}