question_Paper / static /css /styles.css
abhishek2406's picture
appl_file1
8f2f163
Raw History Blame Contribute Delete
9.27 kB
/* Modern CSS Reset and Base Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--primary-color: #4361ee;
--secondary-color: #3f37c9;
--accent-color: #4895ef;
--success-color: #4cc9f0;
--text-color: #2b2d42;
--light-text: #8d99ae;
--background: #f8f9fa;
--card-background: #ffffff;
--border-radius: 8px;
--shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--background);
color: var(--text-color);
line-height: 1.5;
}
.form-container {
max-width: 800px;
margin: 1rem auto;
padding: 0 1rem;
}
.item-container {
background: var(--card-background);
padding: 1rem;
margin-bottom: 1rem;
border-radius: var(--border-radius);
box-shadow: var(--shadow);
position: relative;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
background: #e8f0fe;
padding: 0.5rem;
border-radius: var(--border-radius);
}
.analyze-button {
background: #4361ee;
color: white;
border: none;
padding: 0.5rem 1rem;
border-radius: 4px;
cursor: pointer;
font-size: 0.9rem;
}
.analyze-button:disabled {
background: #ccc;
cursor: not-allowed;
}
.form-row {
margin-bottom: 1rem;
}
.form-row input,
.form-row select,
.form-row textarea {
width: 100%;
padding: 0.5rem;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 1rem;
}
.quantity-unit {
display: flex;
gap: 1rem;
}
.quantity-unit input {
flex: 1;
}
.quantity-unit select {
width: 150px;
}
.description-container {
position: relative;
}
.description-input {
width: 100%;
min-height: 80px;
resize: vertical;
}
.voice-input-container {
position: absolute;
right: 8px;
bottom: 8px;
}
.voice-button {
background: none;
border: none;
color: #4361ee;
cursor: pointer;
padding: 4px;
border-radius: 50%;
}
.voice-button:hover {
background: rgba(67, 97, 238, 0.1);
}
.voice-button.recording {
color: #ef4444;
animation: pulseRecord 2s infinite;
}
.add-entry-button {
display: block;
width: 100%;
padding: 0.75rem;
background: none;
border: 2px dashed #4361ee;
color: #4361ee;
border-radius: var(--border-radius);
margin: 1rem 0;
cursor: pointer;
font-size: 1rem;
}
.submit-button {
display: block;
width: 100%;
padding: 1rem;
background: #4361ee;
color: white;
border: none;
border-radius: var(--border-radius);
cursor: pointer;
font-size: 1rem;
font-weight: 500;
}
@keyframes pulseRecord {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
/* Customer Details Section */
.customer-details {
background: var(--card-background);
padding: 2rem;
border-radius: var(--border-radius);
box-shadow: var(--shadow);
margin-bottom: 2rem;
transform: translateY(0);
transition: var(--transition);
}
.customer-details:hover {
transform: translateY(-2px);
box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.12);
}
/* Form Controls */
.form-control {
width: 100%;
padding: 0.875rem 1rem;
margin-bottom: 1rem;
border: 2px solid #e2e8f0;
border-radius: var(--border-radius);
font-size: 1rem;
transition: var(--transition);
background: var(--card-background);
}
.form-control:focus {
outline: none;
border-color: var(--accent-color);
box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}
/* Select Dropdown */
select.form-control {
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234361ee'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 1rem center;
background-size: 1.25rem;
padding-right: 2.5rem;
}
/* Items Container */
.items-container {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
/* Item Entry */
.item-entry {
background: var(--card-background);
padding: 1.5rem;
border-radius: var(--border-radius);
box-shadow: var(--shadow);
transition: var(--transition);
animation: slideIn 0.3s ease-out;
}
.item-entry:hover {
transform: translateY(-2px);
box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.12);
}
/* Thank You Page */
.thank-you {
text-align: center;
padding: 3rem 1.5rem;
background: var(--card-background);
border-radius: var(--border-radius);
box-shadow: var(--shadow);
margin-top: 2rem;
animation: scaleIn 0.5s ease-out;
}
.thank-you h2 {
color: var(--text-color);
font-size: 2rem;
margin-bottom: 1.5rem;
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
/* Responsive Design */
@media (max-width: 768px) {
.form-container {
margin: 1rem auto;
padding: 0 1rem;
}
.customer-details,
.item-entry {
padding: 1.25rem;
}
.quantity-unit {
grid-template-columns: 1fr;
}
}
/* Accessibility */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
/* Focus States for Accessibility */
:focus {
outline: 3px solid var(--accent-color);
outline-offset: 2px;
}
:focus:not(:focus-visible) {
outline: none;
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: var(--background);
}
::-webkit-scrollbar-thumb {
background: var(--accent-color);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--primary-color);
}
/* Voice Input Styles */
.voice-input-container {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
z-index: 10;
}
.voice-button {
width: 48px;
height: 48px;
border-radius: 50%;
background: linear-gradient(145deg, #4f46e5, #4338ca);
border: none;
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
padding: 12px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.voice-button:hover {
background: linear-gradient(145deg, #4338ca, #3730a3);
transform: translateY(-2px) scale(1.05);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.voice-button:active {
transform: translateY(0) scale(0.95);
}
.voice-button.recording {
background: linear-gradient(145deg, #ef4444, #dc2626);
animation: pulseRecord 1.5s infinite;
box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}
.voice-button:disabled {
opacity: 0.6;
cursor: not-allowed;
background: #9ca3af;
transform: none;
box-shadow: none;
}
.voice-button svg {
width: 24px;
height: 24px;
transition: all 0.3s ease;
}
.voice-button.recording svg {
animation: scaleIcon 1s infinite alternate;
}
.error-message {
position: absolute;
bottom: -30px;
right: 0;
color: #ef4444;
font-size: 12px;
background: rgba(254, 242, 242, 0.95);
padding: 4px 8px;
border-radius: 4px;
white-space: nowrap;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
animation: fadeIn 0.3s ease-in-out;
}
@keyframes pulseRecord {
0% {
box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}
70% {
box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
}
}
@keyframes scaleIcon {
from {
transform: scale(1);
}
to {
transform: scale(1.2);
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Update textarea container for voice button */
.textarea-container {
position: relative;
width: 100%;
margin-bottom: 20px;
}
.textarea-container textarea {
width: 100%;
min-height: 100px;
padding: 12px;
padding-right: 60px;
border: 2px solid #e5e7eb;
border-radius: 8px;
resize: vertical;
font-size: 14px;
line-height: 1.5;
transition: all 0.3s ease;
}
.textarea-container textarea:focus {
outline: none;
border-color: #4f46e5;
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
/* Ripple effect for recording state */
.voice-button.recording::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: rgba(239, 68, 68, 0.3);
animation: ripple 1.5s infinite;
}
@keyframes ripple {
0% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(1.5);
opacity: 0;
}
}