/* =================================== */
/*          Chat Input Styles          */
/* =================================== */

/* Remove default form margin */
#chat-form {
    margin: 0;
}

#chat-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--dark-bg-tertiary); /* Use a variable from the main style */
    border: 1px solid var(--dark-border-color);
    border-radius: 12px; /* More rounded corners */
    padding: 5px 10px;
    gap: 8px;
}

#chat-input-container #message {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--dark-text-primary);
    font-size: 1em;
    padding: 8px 0; /* Vertical padding only */
    margin: 0; /* Reset margin */
    width: 100%; /* Ensure it takes width */
}

#chat-input-container #message::placeholder {
    color: var(--dark-text-secondary);
    opacity: 0.8;
}

/* Style for the icon buttons */
#chat-input-container button {
    background: none;
    border: none;
    color: var(--dark-text-secondary);
    font-size: 1.4em; /* Adjust icon size */
    padding: 5px;
    margin: 0;
    cursor: pointer;
    line-height: 1; /* Prevent extra height */
    flex-shrink: 0; /* Prevent buttons from shrinking */
    transition: color 0.2s ease;
}

#chat-input-container button:hover {
    color: var(--dark-link-color);
}

/* Specific adjustments if needed */
#chat-action-button {
    /* Optional: slightly different style */
}

#chat-send-button {
    color: var(--dark-accent-blue); /* Make send button stand out */
}
#chat-send-button:hover {
    color: var(--dark-link-color);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    #chat-input-container {
        padding: 4px 8px; /* Slightly reduce padding */
        border-radius: 10px;
        gap: 5px;
    }

    #chat-input-container #message {
        font-size: 16px; /* --- 修改：设置为 16px 防止自动缩放 --- */
    }

    #chat-input-container button {
        font-size: 1.3em; /* Slightly smaller icons */
        padding: 4px;
    }
}

.action-menu-popup {
    display: none; /* Hidden by default, toggled by JS */
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 5px;
    top: auto;
    right: auto;
    transform: none;
    background-color: var(--dark-bg-secondary);
    border: 1px solid var(--dark-border-color);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10; /* Ensure it's above the input */
    min-width: 150px; /* Minimum width */
}

/* Style buttons when they are inside the action menu */
#action-menu button {
    display: block; /* Stack vertically */
    width: 100%; /* 强制宽度一致 */
    padding: 8px 12px;
    margin: 2px 0; /* Add small vertical margin between buttons */
    background-color: transparent;
    border: none;
    color: var(--dark-text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    border-radius: 4px; /* Slight rounding */
    white-space: nowrap; /* Prevent wrapping - 确保单行显示 */
    box-sizing: border-box; /* Include padding in width */
    font-family: inherit;
}

#action-menu button:hover {
    background-color: var(--dark-bg-tertiary);
    color: var(--dark-link-color);
}

/* --- Mobile adjustments for menu --- */
@media (max-width: 768px) {
    .action-menu-popup {
        left: 0;
        bottom: 100%;
        margin-bottom: 5px;
        min-width: 120px;
    }
    #action-menu button {
        padding: 7px 10px;
        font-size: 0.85em;
    }
}
