CSS Code
.container {
width: 100%;
max-width: 550px;
}
.ai-input-container {
background: linear-gradient(
135deg,
rgba(13, 17, 23, 0.85) 0%,
rgba(25, 32, 71, 0.85) 100%
);
border-radius: 12px;
padding: 24px;
margin-bottom: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(4px);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.ai-header {
color: #f3f4f6;
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 16px;
}
.input-wrapper {
position: relative;
}
.ai-input-field {
width: 100%;
background-color: #1f2937;
color: #f3f4f6;
border-radius: 8px;
padding: 12px 16px;
border: 1px solid rgba(75, 85, 99, 0.6);
transition: all 0.3s ease;
outline: none;
font-size: 16px;
resize: none;
}
.ai-input-field:focus {
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
border-color: #6366f1;
}
.ai-input-field::placeholder {
color: #9ca3af;
}
.mic-button {
position: absolute;
right: 12px;
top: 12px;
background: none;
border: none;
color: #9ca3af;
cursor: pointer;
transition: color 0.2s ease;
}
.mic-button:hover {
color: #6366f1;
}
.mic-button svg {
width: 20px;
height: 20px;
}
/* 3D Submit Button with animated border */
.submit-button {
position: relative;
margin-top: 12px;
width: 100%;
background-color: #6366f1;
color: white;
border: none;
border-radius: 8px;
padding: 12px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
box-shadow:
0 6px 0 #4f46e5,
0 8px 15px rgba(0, 0, 0, 0.4),
inset 0 0 6px #4e41e5a2;
transform: translateZ(0);
overflow: hidden;
}
.submit-button:before {
content: "";
position: absolute;
top: -4px;
left: -4px;
right: -4px;
bottom: -4px;
background: linear-gradient(90deg, #6366f1, #9089fc, #6366f1);
border-radius: 10px;
z-index: -2;
background-size: 200% 200%;
animation: none;
opacity: 0;
transition: opacity 0.3s ease;
}
.submit-button:hover {
transform: translateY(4px) translateZ(-10px);
box-shadow:
0 2px 0 #4f46e5,
0 4px 8px rgba(0, 0, 0, 0.3);
}
.submit-button:hover:before {
opacity: 1;
animation: borderGradient 1.5s linear infinite;
}
.submit-button:active {
transform: translateY(6px) translateZ(-20px);
box-shadow:
0 0 0 #4f46e5,
0 2px 5px rgba(0, 0, 0, 0.2);
}
.button-icon {
margin-left: 8px;
animation: pulse 2s infinite;
}
.button-icon svg {
width: 20px;
height: 20px;
}
/* Alternative design with 3D button */
.alt-input-wrapper {
display: flex;
align-items: center;
}
.alt-input-field {
flex-grow: 1;
background-color: #1f2937;
color: #f3f4f6;
border-radius: 30px;
padding: 12px 20px;
padding-right: 40px;
border: 1px solid rgba(75, 85, 99, 0.6);
transition: all 0.3s ease;
outline: none;
font-size: 16px;
}
.alt-input-field:focus {
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
border-color: #6366f1;
}
.alt-mic-container {
position: relative;
flex-grow: 1;
background-color: #161e29;
border-radius: 30px;
box-shadow: inset 0 0 6px #0e141d;
}
.alt-mic-button {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: #9ca3af;
cursor: pointer;
transition: color 0.3s cubic-bezier(0.75, 0.18, 0.28, 1.02);
}
.alt-mic-button:hover {
color: #6366f1;
}
.alt-mic-button svg {
width: 20px;
height: 20px;
}
/* 3D circular button */
.alt-submit-button {
position: relative;
margin-left: 8px;
background-color: #6366f1;
color: white;
border: none;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
box-shadow:
0 4px 0 #4f46e5,
0 6px 10px rgba(0, 0, 0, 0.3);
transform: translateZ(0);
overflow: hidden;
}
.alt-submit-button:before {
content: "";
position: absolute;
top: -4px;
left: -4px;
right: -4px;
bottom: -4px;
background: linear-gradient(90deg, #6366f1, #9089fc, #6366f1);
border-radius: 50%;
z-index: -2;
background-size: 200% 200%;
animation: none;
opacity: 0;
transition: opacity 0.3s ease;
}
.alt-submit-button:hover {
transform: translateY(2px) translateZ(-8px);
box-shadow:
0 2px 0 #4f46e5,
0 3px 6px rgba(0, 0, 0, 0.2);
}
.alt-submit-button:hover:before {
opacity: 1;
animation: borderGradient 1.5s linear infinite;
}
.alt-submit-button:active {
transform: translateY(4px) translateZ(-12px);
box-shadow:
0 0 0 #4f46e5,
0 1px 3px rgba(0, 0, 0, 0.2);
}
@keyframes pulse {
0%,
100% {
opacity: 0.6;
}
50% {
opacity: 1;
}
}
@keyframes borderGradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
/* Futuristic elements */
.glow-line {
position: absolute;
width: 100%;
height: 2px;
bottom: -1px;
left: 0;
background: linear-gradient(90deg, transparent, #6366f1, transparent);
opacity: 0.5;
}
.ai-input-field:focus + .mic-button + .glow-line {
opacity: 1;
animation: scan 2s infinite;
}
.alt-input-field:focus + .alt-mic-button + .glow-line {
opacity: 1;
animation: scan 2s infinite;
}
@keyframes scan {
0% {
background-position: -100% 0;
}
100% {
background-position: 200% 0;
}
}