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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

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

header {
    margin-bottom: 40px;
    padding: 30px 20px;
    position: relative;
    background: linear-gradient(to bottom, rgba(196, 30, 58, 0.02), transparent);
    border-radius: 12px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    flex-wrap: wrap;
}

.header-title-section {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.user-section-logged-in {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #C41E3A;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 8px;
}

.user-info svg {
    color: #C41E3A;
}

/* System Section - Removed, now in Settings menu */

/* Control Buttons */
.control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid #C41E3A;
    background: transparent;
    color: #C41E3A;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

.control-btn:hover {
    background: #C41E3A;
    color: white;
    transform: translateY(-1px);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.control-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #C41E3A;
    background: transparent;
    color: #C41E3A;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn-icon:hover {
    background: #C41E3A;
    color: white;
    transform: rotate(90deg) scale(1.05);
}

.control-btn-icon svg {
    width: 18px;
    height: 18px;
}

.settings-btn:hover {
    transform: rotate(90deg) scale(1.05);
}

header h1 {
    font-size: 2.5rem;
    color: #C41E3A;
    margin-bottom: 8px;
    font-weight: 600;
    text-align: left;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
    text-align: left;
}

/* Legacy settings button - now using control-btn-icon */
.settings-button {
    display: none;
}

.search-section {
    margin-bottom: 30px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    /* padding: 0 20px; */
}

.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#location-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#location-input:focus {
    outline: none;
    border-color: #C41E3A;
}

#search-button {
    padding: 14px 32px;
    background-color: #C41E3A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    font-family: inherit;
}

#search-button:hover {
    background-color: #A01A2E;
    transform: translateY(-1px);
}

#search-button:active {
    transform: translateY(0);
}

#search-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 16px;
}

.hidden {
    display: none;
}

.filters-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #C41E3A;
}

#results-container {
    margin-top: 20px;
}

#results {
    display: grid;
    gap: 20px;
}

.result-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid #C41E3A;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.favorite-btn {
    background: transparent;
    border: 2px solid #C41E3A;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.favorite-btn:hover {
    background: #C41E3A;
    transform: scale(1.1);
}

.favorite-btn.active {
    background: #C41E3A;
}

.favorite-btn.active svg {
    fill: white;
    stroke: white;
}

.map-container {
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.map-toggle {
    margin-bottom: 10px;
}

.map-toggle-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    font-family: inherit;
}

.map-toggle-btn:hover {
    background: #C41E3A;
    color: white;
    border-color: #C41E3A;
}

.embedded-map {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.embedded-map iframe {
    width: 100%;
    height: 250px;
    border: none;
    border-radius: 8px;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.title-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
    margin: -2px -4px;
}

.title-link:hover {
    color: #C41E3A;
    background-color: #fafafa;
}

.title-map-icon {
    opacity: 0.5;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.title-link:hover .title-map-icon {
    opacity: 1;
    color: #C41E3A;
}

.result-subtitle {
    color: #666;
    font-size: 0.95rem;
}

.type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.airport {
    background-color: #E8F4F8;
    color: #0066CC;
}

.type-badge.city {
    background-color: #F0F8E8;
    color: #2D7A32;
}

.type-badge.neighborhood {
    background-color: #FFF3E0;
    color: #E65100;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

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

.coordinates {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #666;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: -8px;
}

.map-link:hover {
    background-color: #f5f5f5;
    color: #C41E3A;
    transform: translateX(2px);
}

.map-link:hover .coordinates {
    color: #C41E3A;
    font-weight: 500;
}

.map-icon {
    opacity: 0.6;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.map-link:hover .map-icon {
    opacity: 1;
    color: #C41E3A;
}

.error {
    background-color: #FFF5F5;
    border: 2px solid #C41E3A;
    color: #C41E3A;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-results-text {
    font-size: 1.1rem;
}

.results-count {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    display: inline-block;
}

/* Settings Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    color: #C41E3A;
    font-size: 1.5rem;
    margin: 0;
}

.close-button {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.close-button:hover {
    background: #f0f0f0;
    color: #C41E3A;
}

.modal-body {
    padding: 24px;
}

.settings-section {
    margin-bottom: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(to right, rgba(196, 30, 58, 0.05), rgba(196, 30, 58, 0.02));
    border-bottom: 2px solid #e0e0e0;
}

.section-header svg {
    color: #C41E3A;
    flex-shrink: 0;
}

.settings-section h3 {
    color: #C41E3A;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.section-content {
    padding: 20px;
    background: white;
}

.settings-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

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

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

.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #C41E3A;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.form-help a {
    color: #C41E3A;
    text-decoration: none;
}

.form-help a:hover {
    text-decoration: underline;
}

.status-indicator {
    padding: 10px 16px;
    border-radius: 8px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
}

.status-indicator.configured {
    background: #E8F5E9;
    border-color: #4CAF50;
    color: #2E7D32;
}

.status-indicator.not-configured {
    background: #FFF3E0;
    border-color: #FF9800;
    color: #E65100;
}

#status-text {
    font-weight: 500;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: #C41E3A;
    color: white;
    flex: 1;
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.btn-danger {
    background: #fff5f5;
    color: #C41E3A;
    border: 2px solid #C41E3A;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-danger:hover {
    background: #C41E3A;
    color: white;
}

.btn-danger svg {
    width: 16px;
    height: 16px;
}

/* Cache Info Display */
.cache-info-display {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cache-stats-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.cache-label {
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.cache-stats-value {
    font-weight: 600;
    color: #C41E3A;
    font-size: 18px;
}

/* Account Section */
.account-state {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-account-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-top: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.user-display svg {
    color: #C41E3A;
    flex-shrink: 0;
}

.user-name-display {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.user-email-display {
    font-size: 14px;
    color: #666;
}

@media (max-width: 768px) {
    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .header-top {
        flex-direction: row;
        gap: 15px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .header-title-section {
        text-align: left;
        flex: 1;
        min-width: 0;
    }

    header h1 {
        text-align: left;
        font-size: 1.8rem;
        margin-bottom: 4px;
    }

    .subtitle {
        text-align: left;
        font-size: 0.95rem;
    }

    .header-controls {
        width: auto;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .user-section {
        display: none; /* Hide login/user section on mobile */
    }

    .control-btn-icon {
        width: 36px;
        height: 36px;
    }

    .search-section,
    .filters-section {
        padding-left: 15px;
        padding-right: 15px;
    }

    .search-container {
        flex-direction: column;
    }

    #search-button {
        width: 100%;
    }

    .filters-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }

    .form-actions {
        flex-direction: column;
    }

.btn-primary,
.btn-secondary {
    width: 100%;
}

.auth-form {
    width: 100%;
}

.auth-form h3 {
    margin-bottom: 20px;
    color: #C41E3A;
    font-size: 1.3rem;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.auth-switch a {
    color: #C41E3A;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #C41E3A;
}
}

