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

:root {
    --primary-color: #ff6b35;
    --secondary-color: #ff8c5a;
    --bg-color: #fff5f2;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --shadow: 0 4px 20px rgba(255, 107, 53, 0.15);
    --shadow-hover: 0 8px 30px rgba(255, 107, 53, 0.25);
    --border-radius: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.6;
}

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

.app-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
}

.app-header h1 {
    font-size: 2.2em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), #ff9f6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1em;
}

.search-section {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.search-main {
    flex: 1;
    min-width: 0;
}

.search-box {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 12px;
}

#address-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

#address-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

#address-input::placeholder {
    color: #aaa;
}

.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

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

.address-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.address-suggestion-item:hover {
    background: #fff5f2;
}

.address-suggestion-item .icon {
    font-size: 16px;
}

.address-suggestion-item .name {
    flex: 1;
    font-size: 14px;
    color: var(--text-color);
}

.address-suggestion-item .district {
    font-size: 12px;
    color: var(--text-light);
}

.search-box .buttons-row {
    display: flex;
    gap: 10px;
}

.locate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.locate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

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

.locate-btn.locating {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.search-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.filter-tabs {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
}

.tab-btn:hover {
    background: #eee;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.map-container {
    width: 280px;
    height: 180px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.category-btn {
    flex: 1;
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
}

.category-btn:hover {
    background: #eee;
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.result-info {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #fff5f2, #fff);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.result-info span {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--primary-color);
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-light);
    font-size: 14px;
}

.error-message {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: #d32f2f;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 14px;
}

.restaurant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 80px;
}

.restaurant-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 14px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    gap: 14px;
}

.restaurant-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.restaurant-card.highlighted {
    border-color: #ff6b35;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.3), var(--shadow-hover);
    transform: scale(1.02);
}

.restaurant-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
}

.restaurant-content {
    flex: 1;
    min-width: 0;
}

.restaurant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.restaurant-name {
    font-size: 1em;
    font-weight: 700;
    color: var(--text-color);
    flex: 1;
    word-break: break-word;
}

.restaurant-tag {
    padding: 3px 8px;
    background: linear-gradient(135deg, #fff5f2, #ffe8df);
    color: var(--primary-color);
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.restaurant-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-light);
    font-size: 12px;
}

.restaurant-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.restaurant-address {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #eee;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3em;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 14px;
}

.random-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    background: linear-gradient(135deg, #ff6b35, #ff8c5a);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.random-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 107, 53, 0.5);
}

.random-btn:active {
    transform: translateX(-50%) scale(0.98);
}

.random-btn.show {
    display: block;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    50% {
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

@media (max-width: 768px) {
    .search-section {
        flex-direction: column;
    }
    
    .map-container {
        width: 100%;
        height: 200px;
    }
    
    .app-header h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 600px) {
    .search-section {
        flex-direction: column;
    }
    
    .map-container {
        width: 100%;
        height: 180px;
    }
    
    .app-header h1 {
        font-size: 1.6em;
    }
    
    .buttons-row {
        flex-direction: column;
    }
    
    .locate-btn {
        justify-content: center;
    }
    
    .category-tabs {
        flex-direction: column;
    }
    
    .restaurant-header {
        flex-direction: column;
        gap: 6px;
    }
    
    .restaurant-info {
        flex-direction: column;
        gap: 6px;
    }
}
