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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 600;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.start-week {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.start-week label {
    font-weight: 500;
}

.start-week input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.recurring-options {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.recurring-options:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.recurring-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.recurring-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.recurring-checkbox label {
    font-weight: 500;
    cursor: pointer;
    color: #2c3e50;
    user-select: none;
}

.recurring-checkbox label:hover {
    color: #3498db;
}

.weeks-count {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 28px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.weeks-count.show {
    opacity: 1;
    transform: translateY(0);
}

.weeks-count label {
    font-weight: 500;
    color: #555;
}

.weeks-count input[type="number"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 80px;
    transition: border-color 0.2s ease;
}

.weeks-count input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.weeks-hint {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.add-stop {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.add-stop:hover {
    background: #2980b9;
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.generate-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
    max-width: 200px;
}

.generate-btn:hover {
    background: #219a52;
}

.generate-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.clear-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.clear-btn:hover {
    background: #7f8c8d;
}

.stop-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.stop-header {
    background: #f8f9fa;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.stop-header .stop-number {
    font-weight: 500;
    color: #555;
}

.stop-header:hover {
    background: #e9ecef;
}

.stop-content {
    padding: 20px;
    display: none;
}

.stop-content.open {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.days {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.day-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.day-btn.selected {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.day-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

.delete-stop {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 15px;
}

.delete-stop:hover {
    background: #c0392b;
}

@media (max-width: 600px) {
    .start-week {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .days {
        gap: 6px;
    }
    
    .day-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #718096;
    font-size: 0.95rem;
}







.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.form-group select {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    width: 100%;
    box-sizing: border-box;
}







.calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.calendar-controls h3 {
    font-size: 1.3rem;
    color: #4a5568;
    min-width: 180px;
    text-align: center;
}

.calendar-nav {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

@media (max-width: 600px) {
    .calendar-controls {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .calendar-controls h3 {
        font-size: 1.1rem;
        min-width: 140px;
    }
    
    .calendar-nav {
        padding: 6px 10px;
        font-size: 12px;
    }
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 auto;
    max-width: 100%;
    border: 1px solid #dee2e6;
}

.calendar-header {
    background: #495057;
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-day {
    background: white;
    min-height: 80px;
    max-height: 120px;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.calendar-day.other-month {
    background: #f8fafc;
    color: #94a3b8;
}

.calendar-day.today {
    background: #eff6ff;
    border-color: #3b82f6;
}

.calendar-day.selected-week {
    background: #e3f2fd;
    border-color: #2196f3;
    border-width: 2px;
    box-shadow: inset 0 0 0 1px #2196f3;
}

.calendar-day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 60px;
    overflow-y: auto;
    overflow-x: hidden;
}

.calendar-events::-webkit-scrollbar {
    width: 4px;
}

.calendar-events::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.calendar-events::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.calendar-events::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.more-events-indicator {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background: rgba(73, 80, 87, 0.9);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 500;
    cursor: help;
    z-index: 1;
}

.calendar-event {
    background: #3498db;
    color: white;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event.recurring {
    background: #e74c3c;
    border-left: 3px solid #c0392b;
}

.calendar-event.recurring::after {
    content: "🔄";
    position: absolute;
    right: 4px;
    top: 2px;
    font-size: 10px;
    opacity: 0.8;
}

.event-stop {
    font-weight: 500;
    line-height: 1.2;
}

.event-details {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 10px;
    opacity: 0.9;
}

.event-route {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 600;
}

.event-time {
    font-weight: 500;
}

.calendar-event.go1 {
    background: #495057;
}

.calendar-event.go2 {
    background: #6c757d;
}

.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.route-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.route-card:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.route-header h3 {
    color: #495057;
    font-size: 1.3rem;
    font-weight: 600;
}

.route-badge {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.route-description {
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
    flex-grow: 1;
}

.route-schedule {
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.route-schedule .schedule-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0;
    background: none;
    border: none;
}

.schedule-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
}

.schedule-value {
    color: #6c757d;
    font-size: 0.85rem;
}

.view-stops-btn {
    background: #495057;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
}

.view-stops-btn:hover {
    background: #343a40;
}

@media (max-width: 600px) {
    .routes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .route-card {
        padding: 1rem;
    }
    
    .route-header h3 {
        font-size: 1.1rem;
    }
    
    .view-stops-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    background: #495057;
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.stops-list-item {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: background-color 0.2s ease;
}

.stops-list-item:hover {
    background-color: #f8fafc;
}

.stops-list-item:last-child {
    border-bottom: none;
}

.stop-info {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.stop-details {
    flex: 1;
}

.stop-address {
    color: #666;
    font-size: 0.9rem;
    margin: 0.25rem 0;
    font-style: italic;
}

.stop-coordinates {
    color: #007bff;
    font-size: 0.85rem;
    margin: 0.25rem 0;
    font-family: monospace;
}

.stop-links {
    margin-top: 0.5rem;
}

.maps-link {
    color: #28a745;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.maps-link:hover {
    color: #1e7e34;
    text-decoration: underline;
}

.stop-location-links {
    margin-top: 1rem;
}

.stop-location-links .btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.stop-location-links .btn:hover {
    background: #0056b3;
}



.view-times-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
}

.view-times-btn:hover {
    background: #495057;
}

.stop-times-container {
    padding: 1rem;
}

.back-to-stops {
    margin-bottom: 1.5rem;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 44px;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: #495057;
}

.times-section {
    margin-bottom: 2rem;
}

.times-section h4 {
    color: #495057;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
}

.time-badge {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-badge.weekday {
    border-color: #495057;
    color: #495057;
}

.time-badge.weekend {
    border-color: #6c757d;
    color: #6c757d;
}

.no-times {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    padding: 1rem;
    grid-column: 1 / -1;
}

.time-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-times {
    color: #a0aec0;
    font-style: italic;
    padding: 1rem;
    text-align: center;
    grid-column: 1 / -1;
}

.stop-info-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.stop-info-section h4 {
    color: #495057;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.stop-info-section p {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.stop-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.stop-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer {
    background: #495057;
    color: white;
    padding: 3rem 0;
    margin-top: auto;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section h4 {
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    margin-bottom: 0.75rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.footer-link {
    color: #90cdf4;
    text-decoration: underline;
    font-weight: 500;
}

.footer-link:hover {
    color: white;
}

.footer-disclaimer {
    font-size: 0.85rem;
    color: #a0aec0;
    margin-top: 0.5rem;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.footer-list li:before {
    content: "→";
    color: #90cdf4;
    font-weight: 600;
    position: absolute;
    left: 0;
    top: 0;
}



/* Mobile and tablet responsive design */
@media (max-width: 1024px) {
    .routes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    

    
    .calendar-preview-section,
    .routes-info-section {
        padding: 1.5rem 1rem;
    }
    
    .calendar {
        font-size: 0.75rem;
        gap: 1px;
    }
    
    .calendar-day {
        min-height: 60px;
        max-height: 80px;
        padding: 0.5rem 0.25rem;
    }
    
    .calendar-events {
        max-height: 40px;
    }
    
    .calendar-event {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
        margin-bottom: 0.1rem;
    }
    

    
    .item-controls {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .item-controls select {
        width: 100%;
    }
    
    .checkbox-label {
        padding: 0.75rem;
        border-radius: 6px;
        text-align: center;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        transition: all 0.2s ease;
    }
    
    .checkbox-label:hover,
    .checkbox-label:has(input:checked) {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }
    
    .calendar-controls {
        flex-wrap: wrap;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .calendar-controls h3 {
        width: 100%;
        text-align: center;
        margin: 0;
        order: -1;
    }
    
    .calendar-controls button {
        flex: 1;
        min-width: 120px;
    }
    
    .actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .generate-btn,
    .clear-btn {
        width: 100%;
        justify-content: center;
    }
    
    .route-card {
        padding: 1.25rem;
    }
    
    .route-header {
        margin-bottom: 1rem;
    }
    
    .route-schedule {
        margin: 1rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    

    
    .calendar-preview-section,
    .routes-info-section {
        padding: 1rem;
    }
    
    .calendar-day {
        min-height: 50px;
        max-height: 70px;
        padding: 0.25rem;
    }
    
    .calendar-events {
        max-height: 35px;
    }
    

    
    .modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .stops-list-item {
        padding: 0.75rem;
    }
    
    .stop-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8rem;
    }
    
    .times-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.4rem;
    }
    
    .time-badge {
        padding: 0.4rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .stop-info-section {
        margin-top: 1rem;
    }
    
    .stop-info-section p {
        margin: 0.5rem 0;
        font-size: 0.9rem;
    }
    
    .footer-content {
        padding: 0 12px;
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-weight: 500;
}

.message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message.error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.schedule-item {
    transition: all 0.2s ease;
}

.route-card {
    transition: all 0.2s ease;
}
