/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.info-banner {
    background: #f0f9ff;
    border-bottom: 1px solid #e0f2fe;
    padding: 0.75rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #0369a1;
}

.banner-emoji {
    font-size: 1.4em;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

/* Main container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    width: 100%;
}

/* Process guide */
.process-guide {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.process-guide h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.step-number {
    background: #e0f2fe;
    color: #0369a1;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h3 {
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.step-content p {
    color: #666;
    font-size: 0.95rem;
}

/* Search section */
.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.search-section h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.search-container {
    width: 100%;
}

.search-group {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    padding-left: 2.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    height: 48px;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

/* Search results */
.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-results.active {
    display: block;
}

.search-result {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.search-result:hover {
    background: #f5f5f5;
}

.search-result:last-child {
    border-bottom: none;
}

/* Selected place */
.selected-place {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

.selected-place h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.selected-place p {
    color: #666;
}

.selected-place small {
    color: #888;
    font-size: 0.875rem;
    display: block;
    margin-top: 0.5rem;
}

/* Form section */
.facility-details {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.facility-details h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.changing-table-entry {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

/* Number input group */
.number-input-group {
    max-width: 300px;
    margin-bottom: 1.5rem;  /* Add spacing here */
}

.number-input-container {
    display: flex;
    align-items: center;
    gap: 0;
}

.number-input-container input[type="number"] {
    width: 80px;
    height: 48px;
    text-align: center;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 0;
    margin: 0 -1px;
    padding: 0.75rem;
    -moz-appearance: textfield; /* Firefox */
}

.number-input-container input[type="number"]::-webkit-inner-spin-button,
.number-input-container input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-button {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.number-button:first-child {
    border-radius: 4px 0 0 4px;
}

.number-button:last-child {
    border-radius: 0 4px 4px 0;
}

.number-button:hover {
    background: #e9ecef;
}

.number-button:active {
    background: #dee2e6;
}

/* Disabled state */
.number-button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    color: #333;
    height: 48px;
}

select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

/* Tags preview */
.tags-preview {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tags-preview h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.tags-preview .help-text {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.tags-preview pre {
    font-family: monospace;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
    border: 1px solid #e5e7eb;
}

.tags-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s, transform 0.1s;
}

button:active {
    transform: translateY(1px);
}

.primary-button {
    background: #0066cc;
    color: white;
}

.primary-button:hover {
    background: #0052a3;
}

.copy-button {
    background: #6c757d;
    color: white;
}

.copy-button:hover {
    background: #5a6268;
}

/* OSM button container */
.osm-button-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.osm-button-container .help-text {
    color: #666;
    margin-bottom: 1rem;
}

.osm-button-container .primary-button {
    margin: 0 auto;
}

/* Back link */
.back-link {
    margin-top: 2rem;
}

.back-link a {
    color: #0066cc;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Loading state */
.search-input.loading {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .container {
        padding: 0 0.75rem 1.5rem;
    }

    .process-guide,
    .search-section,
    .changing-table-entry,
    .facility-details {
        padding: 1rem;
    }

    .form-group {
        flex: 100%;
    }

    .number-input-group {
        max-width: none;
    }
    
   
    .number-button {
        width: 64px; /* Larger touch target on mobile */
        height: 64px;
    }
    
    .number-input-container input[type="number"] {
        height: 64px;
    }

    .tags-actions {
        flex-direction: column;
    }
    
    .tags-actions button {
        width: 100%;
        justify-content: center;
    }
}