.search-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0;
    height: 44px;
    background-color: #fff;
    border-radius: 22px;
    /* เปลี่ยนเป็น relative เพื่อให้กล่องคำสั่งซ้อนอยู่ข้างใต้ได้พอดี */
    position: relative; 
    overflow: visible; 
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ทำให้ขอบมนตอนไม่ได้พิมพ์ // */
.search-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: #fff;
    z-index: -1;
}

#searchInput {
    flex-grow: 1;
    padding: 0 12px;
    font-size: 15px;
    border: none;
    outline: none;
    background-color: transparent;
    color: #282c34;
    box-sizing: border-box;
    font-family: 'IBM Plex Sans Thai Looped', sans-serif;
    width: 100%;
    min-width: 0;
    height: 100%;
}

#searchInput::placeholder {
    color: #8c8c8c !important;
    opacity: 0.7 !important;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#searchInput:focus::placeholder { opacity: 0.5 !important; }

.search-button {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    border: none;
    background: transparent;
}

.search-button:hover { background-color: rgba(0, 0, 0, 0.05); }

.clear-button { color: #cc6666; }
.clear-button:hover { background-color: rgba(204, 102, 102, 0.1); }

.www-button { color: #61afef; padding-right: 14px; }
.www-button:hover { background-color: rgba(97, 175, 239, 0.1); }

.random-button {
    color: #98c379;
    display: flex;
    padding-left: 10px;
    padding-right: 14px;
}
.random-button:hover { background-color: rgba(152, 195, 121, 0.1); }

.voice-button {
    width: 32px;
    height: 32px;
    margin-left: 6px;
    border-radius: 50%;
    padding: 0;
    background-color: #f0f2f5; 
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-button:hover {
    background-color: #dce1e8;
    color: #1a73e8;
}

.voice-button.listening {
    color: #ffffff;
    background-color: #ff4545;
    animation: micPulseBg 1.5s infinite;
}

@keyframes micPulseBg {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 69, 69, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 69, 69, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 69, 69, 0); }
}

.search-container.listening-mode {
    animation: rgbAmbientPulse 3s linear infinite alternate;
}

@keyframes rgbAmbientPulse {
    0% { box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.3); }
    33% { box-shadow: inset 0 0 10px rgba(0, 255, 50, 0.3); }
    66% { box-shadow: inset 0 0 10px rgba(50, 0, 255, 0.3); }
    100% { box-shadow: inset 0 0 10px rgba(255, 0, 100, 0.3); }
}

/* --- Command Suggestions Dropdown --- */
.command-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #282c34;
    border: 1px solid #3d4451;
    border-radius: 10px;
    margin-top: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.command-suggestions.active {
    display: flex;
}

.command-item {
    padding: 12px 15px;
    color: #abb2bf;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #3d4451;
    transition: background 0.2s;
    font-size: 14px;
}

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

.command-item:hover {
    background: #3d4451;
    color: #61afef;
}

.command-item i {
    width: 20px;
    text-align: center;
    color: #61afef;
}

.command-item .cmd-name {
    font-weight: 600;
    color: #98c379;
    min-width: 70px;
}

.command-item .cmd-desc {
    font-size: 13px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}