chatbot / static /styles.css
Yaswanth56's picture
Update static/styles.css
cf231bc verified
raw
history blame
4.43 kB
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f0f2f5;
overflow: auto;
}
.chat-container {
width: 100%;
max-width: 400px; /* Maximum width for larger screens */
height: 80vh; /* Use viewport height for responsiveness */
max-height: 600px; /* Maximum height cap */
border: 1px solid #ccc;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: white;
display: flex;
flex-direction: column;
margin: 10px; /* Add margin for better spacing on mobile */
}
.chat-header {
background-color: #f28c38;
color: white;
padding: 10px;
text-align: center;
font-size: 20px;
flex-shrink: 0;
}
.chat-messages {
flex: 1; /* Allow messages to take available space */
overflow-y: auto;
padding: 15px; /* Reduced padding for mobile */
box-sizing: border-box;
}
.bot-message {
background-color: #fffbe6;
padding: 10px;
margin: 10px 0;
border-radius: 5px;
max-width: 70%;
word-wrap: break-word;
font-size: 14px; /* Smaller font for mobile */
}
.user-message {
background-color: #e1f5fe;
padding: 10px;
margin: 10px 0;
border-radius: 5px;
max-width: 70%;
margin-left: auto;
text-align: right;
word-wrap: break-word;
font-size: 14px; /* Smaller font for mobile */
}
.chat-input {
display: flex;
padding: 10px;
border-top: 1px solid #ccc;
flex-shrink: 0;
}
.chat-input input {
flex: 1;
padding: 8px; /* Slightly larger padding for better touch targets on mobile */
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
font-size: 14px; /* Smaller font for mobile */
min-height: 40px; /* Ensure input is tappable on mobile */
}
.chat-input button {
padding: 8px 15px; /* Larger padding for better touch targets on mobile */
margin-left: 10px;
background-color: #f28c38;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
font-size: 14px; /* Smaller font for mobile */
min-height: 40px; /* Ensure button is tappable on mobile */
}
.chat-input button:hover {
background-color: #d8702a;
}
.option-button {
display: inline-block;
padding: 10px 15px; /* Adjusted padding for mobile */
margin: 5px;
background-color: #9c27b0;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
font-size: 14px; /* Smaller font for mobile */
min-width: 100px; /* Minimum width for readability */
text-align: center;
}
.option-button.green {
background-color: #4caf50;
}
.option-button.red {
background-color: #f44336;
}
.option-button:hover {
opacity: 0.9;
}
/* Media Queries for Responsiveness */
@media (max-width: 768px) {
.chat-container {
max-width: 100%; /* Full width on mobile */
height: 90vh; /* Use more of the viewport on mobile */
margin: 5px; /* Reduced margin on mobile */
}
.chat-header {
font-size: 18px; /* Slightly smaller header on mobile */
}
.chat-messages {
padding: 10px; /* Further reduced padding for mobile */
}
.chat-input input,
.chat-input button {
padding: 6px; /* Smaller padding on mobile */
font-size: 12px; /* Even smaller font on mobile */
min-height: 35px; /* Adjusted for mobile touch */
}
.option-button {
padding: 8px 12px; /* Smaller padding for option buttons */
font-size: 12px; /* Smaller font for option buttons */
min-width: 90px; /* Adjusted minimum width */
}
}
@media (min-width: 769px) {
.chat-container {
margin: 20px; /* Increased margin on larger screens */
}
.chat-header {
font-size: 22px; /* Slightly larger header on desktop */
}
.bot-message,
.user-message {
font-size: 16px; /* Larger font for desktop */
}
.chat-input input,
.chat-input button {
font-size: 16px; /* Larger font for desktop */
min-height: 45px; /* Adjusted for desktop */
}
.option-button {
font-size: 16px; /* Larger font for desktop */
min-width: 120px; /* Adjusted minimum width */
}
}