/**
 * SeesawInput Component Styles
 *
 * A reusable input component with:
 * - Clear button (left)
 * - Mode toggle button (filter/search) (left, optional)
 * - Input field (center)
 * - Add button (right)
 * - Autocomplete dropdown
 */

/* Container */
.seesaw-input {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    overflow: visible;
    margin-bottom: 0;
}

.seesaw-input .seesaw-input__wrapper {
    display: flex;
    height: 44px;
    position: relative;
    background: white;
    border-radius: 14px;
}

/* Left section (Clear + Mode Toggle) */
.seesaw-input__left {
    display: flex;
}

.seesaw-input__btn {
    width: 40px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: none;
    outline: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.seesaw-input__btn:hover {
    background: #eeeeee;
}

.seesaw-input__btn--clear {
    color: var(--color-text-disabled);
    border-radius: 14px 0 0 14px;
}

.seesaw-input__btn--clear:hover {
    color: var(--color-text-muted);
}

.seesaw-input__btn--mode {
    color: var(--color-text-disabled);
    border-left: 1px solid #e0e0e0;
}

.seesaw-input__btn--mode.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.seesaw-input__btn--mode:hover {
    color: var(--color-primary);
}

.seesaw-input__btn--mode .material-icons {
    font-size: 20px;
}

/* Center section (Input) */
.seesaw-input__center {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: white;
    position: relative;
}

.seesaw-input__field {
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-primary);
    letter-spacing: 0.1px;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.seesaw-input__field::placeholder {
    color: var(--color-text-disabled);
}

/* Right section (Add button) */
.seesaw-input__btn--add {
    color: var(--color-success);
    border-radius: 0 14px 14px 0;
}

.seesaw-input__btn--add:hover {
    color: var(--color-success-hover);
    background: #e8f5e9;
}

/* Autocomplete Dropdown */
.seesaw-input__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.seesaw-input__dropdown.show {
    display: block;
}

.seesaw-input__dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    color: var(--color-text-primary);
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.seesaw-input__dropdown-item:hover {
    background-color: #f8f9fa;
}

.seesaw-input__dropdown-item.active {
    background-color: var(--color-primary-light);
}

.seesaw-input__dropdown-item-name {
    flex: 1;
}

.seesaw-input__dropdown-item-stock {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.seesaw-input__dropdown-item--virtual {
    color: var(--color-text-muted);
}

.seesaw-input__dropdown-empty {
    padding: 16px;
    text-align: center;
    color: var(--color-text-disabled);
    font-size: 16px;
}

/* Ripple effect */
.seesaw-input .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: seesaw-ripple 0.6s ease-out;
}

@keyframes seesaw-ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Mode indicator tooltip */
.seesaw-input__mode-indicator {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #424242;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.seesaw-input__btn--mode:hover .seesaw-input__mode-indicator {
    opacity: 1;
}

/* Hidden state for mode toggle */
.seesaw-input--no-toggle .seesaw-input__btn--mode {
    display: none;
}

.seesaw-input--no-toggle .seesaw-input__btn--clear {
    border-radius: 14px 0 0 14px;
}
