/* Strava-Style Color Palette */
:root {
    --bg-grey: #f7f7f7;
    --card-white: #ffffff;
    --text-primary: #242428;
    --text-secondary: #6d6d78;
    --text-muted: #a0a0a8;
    --accent-blue: #1a365d;
    --accent-blue-hover: #0f2744;
    --accent-disabled: #a0a0a8;
    --border-light: #e5e5e5;
    --border-medium: #d0d0d0;
    --star-gold: #ffc107;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #dc2626;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-grey);
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

header {
    margin-bottom: 30px;
    text-align: center;
}

h1 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-white);
    border-radius: 6px;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2d8a5f, #3bb78f, #0bab64, #45b69c);
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.form-row-options {
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 0;
}

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

.form-group-medium {
    flex: 1;
    max-width: 280px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 6px;
}

.checkbox-label span {
    color: var(--text-secondary);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--card-white);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-white);
    border: 1px solid var(--border-medium);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

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

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background: rgba(26, 54, 93, 0.08);
}

.autocomplete-suggestion-name {
    font-weight: 500;
    color: var(--text-primary);
}

.autocomplete-suggestion-type {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--accent-blue);
}

/* Unified Button Styles */
button {
    padding: 12px 24px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: var(--accent-blue-hover);
}

button:disabled {
    background: var(--accent-disabled);
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-blue);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
}

.btn-secondary {
    background: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--accent-blue);
}

.error {
    padding: 15px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 4px;
    color: var(--error-text);
    margin-bottom: 20px;
}

.results-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--card-white);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.results-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.summary {
    background: var(--card-white);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-blue);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-blue);
}

.summary-item {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.days-list {
    margin-bottom: 20px;
}

.day-card {
    background: var(--card-white);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-blue);
}

.day-card h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.day-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.day-info-item {
    font-size: 14px;
    color: var(--text-primary);
}

.day-info-item strong {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 5px;
}

/* Way Type Stacked Bar */
.waytype-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.waytype-bar {
    display: flex;
    height: 16px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border-light);
    margin-bottom: 10px;
}

.waytype-segment {
    height: 100%;
    min-width: 2px;
}

.waytype-segment.waytype-0 { background: var(--accent-blue); }
.waytype-segment.waytype-1 { background: #4a7c9b; }
.waytype-segment.waytype-2 { background: #7aa3b8; }
.waytype-segment.waytype-3 { background: #a8c5d4; }
.waytype-segment.waytype-4 { background: #c5d8e2; }
.waytype-segment.waytype-5 { background: #dfe9ef; }

.waytype-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.waytype-legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.waytype-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 5px;
    flex-shrink: 0;
}

.waytype-dot.waytype-0 { background: var(--accent-blue); }
.waytype-dot.waytype-1 { background: #4a7c9b; }
.waytype-dot.waytype-2 { background: #7aa3b8; }
.waytype-dot.waytype-3 { background: #a8c5d4; }
.waytype-dot.waytype-4 { background: #c5d8e2; }
.waytype-dot.waytype-5 { background: #dfe9ef; }

.waytype-percent {
    color: var(--text-muted);
    margin-left: 4px;
}

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

.actions button {
    flex: 1;
}

.map-section {
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
}

.map-container {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-medium);
    background: var(--bg-grey);
}

.custom-marker {
    background: transparent;
    border: none;
}

/* Feedback button */
.btn-feedback {
    background: var(--accent-blue);
}

.btn-feedback:hover {
    background: var(--accent-blue-hover);
}

.btn-feedback:disabled {
    background: var(--accent-disabled);
    cursor: not-allowed;
}

/* Feedback Section */
.feedback-section {
    margin-top: 25px;
    padding: 25px;
    background: var(--card-white);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.feedback-title {
    color: var(--text-primary);
    margin: 0 0 20px 0;
    font-size: 1.3em;
    text-align: center;
}

.feedback-step {
    text-align: center;
}

.feedback-prompt {
    color: var(--text-primary);
    font-size: 1.1em;
    margin-bottom: 20px;
}

.optional-hint {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* Star Rating */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.star {
    font-size: 42px;
    color: var(--border-medium);
    cursor: pointer;
    transition: color 0.2s, transform 0.15s;
    user-select: none;
}

.star:hover {
    transform: scale(1.15);
}

.star.active {
    color: var(--star-gold);
}

.rating-label {
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 500;
    min-height: 28px;
}

/* Feedback Reasons */
.feedback-reasons {
    margin-bottom: 20px;
    text-align: left;
}

.reasons-category {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    margin: 4px;
    background: var(--card-white);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-primary);
    transition: all 0.2s;
}

.feedback-chip:hover {
    border-color: var(--accent-blue);
    background: rgba(26, 54, 93, 0.05);
}

.feedback-chip input[type="checkbox"] {
    display: none;
}

.feedback-chip:has(input:checked) {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Feedback Action Buttons */
.feedback-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

.btn-primary-small {
    padding: 10px 24px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary-small:hover {
    background: var(--accent-blue-hover);
}

.btn-primary-small:disabled {
    background: var(--accent-disabled);
    cursor: not-allowed;
}

.btn-secondary-small {
    padding: 10px 24px;
    background: var(--text-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary-small:hover {
    background: var(--text-primary);
}

/* Thank You Message */
.thank-you-message {
    padding: 30px;
}

.thank-you-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    font-size: 28px;
    margin-bottom: 15px;
}

.thank-you-message p {
    color: var(--text-primary);
    font-size: 1.2em;
    font-weight: 500;
    margin: 0;
}

.thank-you-subtext {
    color: var(--text-secondary) !important;
    font-size: 0.95em !important;
    font-weight: 400 !important;
    margin-top: 8px !important;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .form-row-options {
        gap: 12px;
    }

    .form-group-small,
    .form-group-medium {
        min-width: 100%;
        max-width: 100%;
    }

    .day-info {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .map-container {
        height: 300px;
    }

    .star {
        font-size: 36px;
    }

    .feedback-chip {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}
