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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

#pageTitle {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

#headerCityLink {
    color: #fff;
    background: linear-gradient(135deg, #764ba2, #667eea);
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(118, 75, 162, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

#headerCityLink:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.35);
    opacity: 0.95;
}

.city-menu {
    position: relative;
    display: inline-block;
}

.city-menu.hidden {
    display: none;
}


.city-menu.show {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 1px solid #e6e6f0;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.14);
    padding: 8px;
    z-index: 1000;
    min-width: 600px;
    max-width: 90vw;
    max-height: 70vh;
    overflow: auto;
}

/* Responsive fallbacks for city menu grid */
@media (max-width: 768px) {
    .city-menu.show {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-width: 0;
        width: 90vw;
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .city-menu.show {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        padding: 6px;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: 80vh;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .city-menu button {
        padding: 8px 8px;
        font-size: 12px;
        border-radius: 6px;
    }
}

.city-menu button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #f7f7ff, #f1f4ff);
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    color: #333;
    font-weight: 600;
    transition: all 0.15s ease;
}

.city-menu button:hover {
    background: linear-gradient(135deg, #ebedff, #e2e8ff);
    color: #4a55c4;
    border-color: #d5d8ff;
    box-shadow: 0 6px 14px rgba(102, 118, 234, 0.18);
}

.city-menu button:active {
    transform: translateY(1px);
}

header p {
    color: #666;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 968px) {
    main {
        grid-template-columns: 1fr;
    }
}

.form-section, .results-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
}

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

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

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.criteria-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.criterion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.criterion label {
    font-weight: 600;
    color: #333;
}

.stars {
    display: flex;
    gap: 5px;
}

.star {
    font-size: 24px;
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
    user-select: none;
}

.star:hover,
.star.active {
    color: #ffc107;
}

.btn-submit, .btn-danger {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
    margin-top: 10px;
}

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

.location-type-toggle {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
    flex-wrap: wrap;
}

.toggle-btn {
    padding: 8px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    color: #666;
    flex: 1 1 0;
    min-width: 0;
}

.toggle-btn:hover {
    background: #e0e0e0;
}

.toggle-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-bar {
    margin-bottom: 20px;
}

.filter-bar select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 10px;
}

.neighborhood-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.neighborhood-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

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

.rating-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: white;
    border-radius: 5px;
}

.rating-item span:first-child {
    color: #666;
    font-size: 14px;
}

.rating-item span:last-child {
    color: #ffc107;
    font-weight: 600;
}

.average-score {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.opinions-section {
    margin-top: 15px;
    padding: 12px;
    background: #e8f0ff;
    border-radius: 5px;
}

.opinions-section h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 14px;
}

.opinions-list {
    list-style: none;
    padding: 0;
}

.opinions-list li {
    padding: 8px;
    margin-bottom: 5px;
    background: white;
    border-radius: 5px;
    border-left: 3px solid #667eea;
    font-size: 14px;
    color: #333;
}

.opinions-list li:last-child {
    margin-bottom: 0;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    header {
        padding: 15px 10px;
        margin-bottom: 20px;
    }

    #pageTitle {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 16px;
    }

    #pageTitle span:first-child {
        flex: 0 0 100%;
    }

    #headerCityLink {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .location-type-toggle {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        padding: 6px;
        width: 100%;
        margin-top: 6px;
    }

    .toggle-btn {
        padding: 8px 4px;
        font-size: 11px;
        border-radius: 5px;
        min-width: 0;
    }

    #headerSubtitle {
        font-size: 13px;
        margin: 8px 0 0 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .container {
        max-width: 100%;
    }

    header {
        padding: 10px 8px;
        margin-bottom: 15px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    #pageTitle {
        display: block;
        gap: 0;
    }

    #pageTitle span:first-child {
        display: block;
        margin-bottom: 4px;
    }

    #pageTitle span:nth-child(2) {
        display: block;
        width: 100%;
    }

    #headerCityLink {
        display: inline-block;
        padding: 6px 10px;
        font-size: 12px;
    }

    .location-type-toggle {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 4px;
        padding: 4px;
        width: 100%;
        margin-top: 4px;
    }

    .toggle-btn {
        padding: 6px 2px;
        font-size: 10px;
        border-radius: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    #headerSubtitle {
        font-size: 12px;
        margin: 6px 0 0 0;
        padding: 0 4px;
    }
}