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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    padding: 30px 0;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.search-form {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    position: relative;
}

.form-group.small {
    flex: 0 0 100px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion:last-child {
    border-bottom: none;
}

.suggestion:hover {
    background: #f5f7ff;
}

.suggestion .country {
    color: #888;
    font-size: 0.85rem;
    float: right;
}

.options {
    flex-direction: column;
    gap: 12px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-group .hint {
    color: #888;
    font-size: 0.85rem;
    font-weight: 400;
}

.checkbox-group .hint.disabled {
    color: #cc0000;
}

.btn-search {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-search:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.results-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-height: 200px;
}

.info-text {
    text-align: center;
    color: #666;
    line-height: 1.8;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error {
    background: #fee;
    color: #c00;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.no-results {
    text-align: center;
    color: #666;
    padding: 40px;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.results-header h2 {
    font-size: 1.3rem;
    color: #333;
}

.badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.searched-origins {
    color: #888;
    font-size: 0.85rem;
}

.flights-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.flight-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.flight-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.flight-price {
    text-align: center;
    min-width: 100px;
}

.flight-price .price {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.flight-price .currency {
    color: #888;
    font-size: 0.8rem;
}

.flight-details {
    flex: 1;
}

.flight-details .route {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.flight-details .arrow {
    color: #888;
    margin: 0 10px;
}

.flight-details .info {
    display: flex;
    gap: 15px;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.flight-details .direct {
    color: #2a9d2a;
    font-weight: 500;
}

.flight-details .stops {
    color: #e67700;
}

.flight-details .times {
    color: #888;
    font-size: 0.85rem;
}

.btn-book {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-book:hover {
    background: #218838;
}

footer {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Bus Search Styles */
.btn-bus {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-bus:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.source-info {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    margin-top: 15px;
}

.bus-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bus-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bus-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.bus-price {
    text-align: center;
    min-width: 120px;
}

.bus-price .price {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #28a745;
}

.bus-price .price-max {
    display: block;
    font-size: 0.9rem;
    color: #888;
}

.bus-details {
    flex: 1;
}

.bus-details .route {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.bus-details .arrow {
    color: #888;
    margin: 0 10px;
}

.bus-details .info {
    display: flex;
    gap: 15px;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.bus-details .operator {
    font-weight: 600;
    color: #333;
}

.bus-details .direct {
    color: #2a9d2a;
    font-weight: 500;
}

.bus-details .transfers {
    color: #e67700;
}

.bus-details .source-tag {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

.external-links-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.external-links-section p {
    color: #666;
    margin-bottom: 15px;
}

.external-links {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-external {
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #ddd;
}

.btn-external:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* Branded booking buttons */
.btn-rome2rio { background: #00b140; color: white; border-color: #00b140; }
.btn-rome2rio:hover { background: #009933; }

.btn-omio { background: #0066cc; color: white; border-color: #0066cc; }
.btn-omio:hover { background: #0052a3; }

.btn-flixbus { background: #73d700; color: #333; border-color: #73d700; }
.btn-flixbus:hover { background: #5fb800; }

.btn-skyscanner { background: #0770e3; color: white; border-color: #0770e3; }
.btn-skyscanner:hover { background: #0560c2; }

.btn-google { background: #4285f4; color: white; border-color: #4285f4; }
.btn-google:hover { background: #3367d6; }

.btn-kayak { background: #ff690f; color: white; border-color: #ff690f; }
.btn-kayak:hover { background: #e55d0d; }

.btn-booking { background: #003580; color: white; border-color: #003580; }
.btn-booking:hover { background: #00264d; }

.btn-hostelworld { background: #f47521; color: white; border-color: #f47521; }
.btn-hostelworld:hover { background: #d9651d; }

.btn-airbnb { background: #ff5a5f; color: white; border-color: #ff5a5f; }
.btn-airbnb:hover { background: #e04e53; }

/* Booking links container */
.booking-links-container {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.booking-links-container h4 {
    font-size: 0.95rem;
    color: #555;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.booking-links-container h4:first-child {
    margin-top: 0;
}

.link-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.sources {
    color: #888;
    font-size: 0.85rem;
}

/* Map / Reiseplaner Styles - Vertical Layout */
.map-container-vertical {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.map-view-large {
    width: 100%;
    height: 450px;
    z-index: 1;
}

.map-controls {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.map-controls-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-controls-top {
    display: flex;
    gap: 15px;
    align-items: center;
}

.map-search-inline {
    position: relative;
    flex: 0 0 180px;
}

.map-search-inline input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.map-search-inline input:focus {
    outline: none;
    border-color: #667eea;
}

.markers-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.markers-inline > span {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.markers-horizontal {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.markers-horizontal li {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
}

.markers-horizontal li .marker-num {
    width: 16px;
    height: 16px;
    background: rgba(255,255,255,0.3);
    font-size: 0.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.markers-horizontal li .marker-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: white;
}

.markers-horizontal .btn-remove {
    width: 16px;
    height: 16px;
    background: rgba(255,255,255,0.3);
    font-size: 0.65rem;
    padding: 0;
    line-height: 16px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
}

.markers-horizontal .btn-remove:hover {
    background: #dc3545;
}

.map-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-small.btn-secondary:hover {
    background: #5a6268;
}

.btn-small.btn-map {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-small.btn-map:hover:not(:disabled) {
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.4);
}

.btn-small.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-small.btn-primary:hover {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.map-hint {
    margin: 10px 0 0 0;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
}

/* Legacy styles for compatibility */
.marker-num {
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.marker-name {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove {
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-remove:hover {
    background: #c82333;
}

.map-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-secondary {
    padding: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-map {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.btn-map:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

.map-view {
    flex: 1;
    min-height: 450px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
}

/* Route Suggestion Styles */
.route-suggestion {
    margin-bottom: 20px;
}

.route-suggestion h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
}

.suggestion-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.8;
    color: #444;
}

.optimized-route {
    margin-top: 20px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 12px;
}

.optimized-route h3 {
    font-size: 1rem;
    color: #2e7d32;
    margin-bottom: 10px;
}

.optimized-route ol {
    margin: 0;
    padding-left: 25px;
}

.optimized-route li {
    padding: 5px 0;
    color: #333;
}

/* Connection Segments */
.connections-result h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

.connection-segment {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 15px;
}

.connection-segment h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-group.small {
        flex: 1;
    }

    .flight-card,
    .bus-card {
        flex-direction: column;
        text-align: center;
    }

    .flight-price,
    .bus-price {
        min-width: auto;
    }

    .flight-details .info,
    .bus-details .info {
        justify-content: center;
        flex-wrap: wrap;
    }

    .tab-nav {
        flex-direction: column;
    }

    .external-links {
        flex-direction: column;
    }

    /* New vertical map layout mobile */
    .map-view-large {
        height: 300px;
    }

    .map-controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .map-search-inline {
        flex: 1;
    }

    .markers-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-buttons {
        flex-direction: column;
    }

    .btn-small {
        width: 100%;
    }
}
