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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

:tool-form-active {
    outline: 5px solid lightblue;
}

:tool-submit-active {
    outline: 5px solid red;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

.results-container {
    max-width: 900px;
}

/* Simulation Settings Style */
.simulation-settings {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.simulation-settings label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 5px;
    display: block; /* Ensure label is block for inputs */
}

.simulation-settings input[type="number"] {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ced4da;
    margin-bottom: 0;
}

/* Specific aligner for the settings grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: end; /* Align input and checkbox vertically */
}

.settings-checkbox {
    display: flex;
    align-items: center;
    height: 42px; /* Match height of input field roughly */
    padding-bottom: 2px;
}

.settings-checkbox input {
    margin-right: 8px;
    width: auto;
}

.settings-checkbox label {
    margin-bottom: 0;
    text-transform: none; /* Keep normal case for the workaround label */
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

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

.hidden {
    display: none;
}

/* Results page styles */
.search-summary {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.search-summary h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
}

.search-summary p {
    color: #666;
    font-size: 14px;
}

.back-button {
    background: #e0e0e0;
    color: #333;
    font-size: 14px;
    padding: 10px 20px;
    width: auto;
    margin-bottom: 20px;
}

.back-button:hover {
    background: #d0d0d0;
}

.flight-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.flight-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.airline-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.airline-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.airline-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.price {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.flight-details {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
}

.flight-time {
    text-align: center;
}

.time {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.airport {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.flight-path {
    text-align: center;
    color: #999;
}

.duration {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.stops {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
}

.expand-button {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    font-size: 14px;
    margin-top: 0;
}

.expand-button:hover {
    background: #667eea;
    color: white;
    transform: none;
}

.expanded-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    align-items: start;
    gap: 10px;
}

.detail-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.detail-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.pagination button {
    flex: 1;
    max-width: 150px;
    padding: 12px;
    font-size: 16px;
}

.page-info {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .row, .settings-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 30px 20px;
    }

    .flight-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
    }

    .pagination button {
        max-width: none;
    }
}