:root {
    --primary-color: #2d3436;
    --accent-color: rgba(47, 114, 223, 0.827);
    --border-color: #e0e0e0;
    --bg-color: #eef0f4;
    --text-color: #545757cb;
    --suggestion-hover: #f8f9fa;
    --danger-color: #ff4757;
    --text-card-color:#609393cb;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #f8f9fa;
        --bg-color: #2d3436;
        --text-color: #f8f9fa;
        --suggestion-hover: #3d4346;
        --border-color: #4d5356;
        --danger-color: #ff6b81;
        --text-card-color:#5eefefcb;
    }
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    min-width: 500px;
}

.search-container {
    max-width: 600px;
    margin: 5% auto 0px;
    position: relative;
}

.search-box {
    height: 46px;
    display: flex;
    align-items: center;
    border: 1px solid var(--accent-color);
    border-radius: 32px;
    padding: 0 2px 0 16px;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.search-box.focused {
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.25);
}

#searchInput {
    flex: 1;
    border: none;
    padding: 12px 0;
    font-size: 14px;
    background: transparent;
    outline: none;
    color: var(--text-color);
    margin: 0 8px;
    text-align: center;
    height: 42px;
}

#searchButton {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    margin-left: 8px;
}
#searchButton:hover {
    opacity: 0.9;
    transform: scale(0.98);
}

.engine-select {
    border: none;
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 8px 0;
    margin-right: 8px;
    text-align: center;
    outline: none;
}

.suggestions-container {
    position: absolute;
    width: 100%;
    background: var(--bg-color);
    border-radius: 16px;
    margin-top: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: none;
}

.suggestions-container::-webkit-scrollbar {
    display: none;
}

.suggestion-item {
    padding: 14px 24px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: var(--suggestion-hover);
}

.suggestion-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.highlight {
    color: var(--accent-color);
    font-weight: 600;
}

.search-meta {
    padding: 12px 24px;
    color: #666;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-history {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
}

.clear-history:hover {
    opacity: 0.9;
    transform: scale(0.98);
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    margin: 0 4px;
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--text-color);
    font-size: 18px;
}

.search-button-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

.delete-history {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.2em;
    padding: 0 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.suggestion-item:hover .delete-history {
    opacity: 1;
}

.quick-action-panel {
    display: none;
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.weather-card, .time-container {
    text-align: center;
    font-size: 2.5em;
    color: var(--text-card-color);
    text-shadow: 0 1px 2px rgba(16, 16, 16, 0.4);
    padding: 12px 0;
    margin-bottom: 8px;
}
.time-container:hover {
    opacity: 0.9;
    transform: scale(0.98);
}
.time-card {
    padding: 12px;
    border-radius: 8px;
    background: rgba(108, 92, 231, 0.1);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (max-width: 768px) {
    .search-container {
        margin: 8% auto 0px;
    }

    #searchInput {
        padding: 10px 0;
        font-size: 14px;
    }

    #searchButton {
        padding: 12px 24px;
    }
}