Spaces:
Running
Running
File size: 9,441 Bytes
2978bba | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | /**
* MorphGuard Smart Validator Styles
*
* Styling for the AI-assisted form validation system,
* with theme compatibility and responsive design.
*/
/* Container for feedback elements */
.smart-feedback {
margin-top: 0.5rem;
transition: all 0.3s ease;
}
/* Error message styling */
.smart-error-message {
color: var(--error, #ef4444);
font-size: 0.875rem;
line-height: 1.25rem;
padding: 0.25rem 0;
animation: smartFadeIn 0.3s ease-in-out;
display: flex;
align-items: center;
}
.smart-error-message::before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: contain;
margin-right: 0.5rem;
flex-shrink: 0;
}
/* Error state for inputs */
.smart-error {
border-color: var(--error, #ef4444) !important;
box-shadow: 0 0 0 1px var(--error, #ef4444) !important;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.75rem center;
background-size: 1.25rem 1.25rem;
padding-right: 2.5rem !important;
transition: all 0.2s ease;
}
/* Valid state for inputs */
.smart-valid {
border-color: var(--success, #10b981) !important;
box-shadow: 0 0 0 1px var(--success, #10b981) !important;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.75rem center;
background-size: 1.25rem 1.25rem;
padding-right: 2.5rem !important;
transition: all 0.2s ease;
}
/* Select elements need special handling for background positioning */
select.smart-error,
select.smart-valid {
background-position: right 2rem center;
}
/* Error and valid states for file inputs (which can't have backgrounds) */
input[type="file"].smart-error {
border: 1px solid var(--error, #ef4444);
background-image: none;
padding-right: inherit !important;
}
input[type="file"].smart-valid {
border: 1px solid var(--success, #10b981);
background-image: none;
padding-right: inherit !important;
}
/* Custom file input label for validation states */
.smart-file-label.error {
color: var(--error, #ef4444);
}
.smart-file-label.valid {
color: var(--success, #10b981);
}
/* Suggestions styling */
.smart-suggestions-list {
margin-top: 0.5rem;
border: 1px solid var(--border-color, #e5e7eb);
border-radius: 0.375rem;
background-color: var(--bg-secondary, #f9fafb);
padding: 0.5rem;
animation: smartFadeIn 0.3s ease-in-out;
}
.smart-suggestion-item {
padding: 0.5rem;
margin-bottom: 0.25rem;
border-radius: 0.25rem;
cursor: pointer;
color: var(--accent-primary, #3b82f6);
transition: all 0.2s ease;
display: flex;
align-items: center;
}
.smart-suggestion-item:last-child {
margin-bottom: 0;
}
.smart-suggestion-item:hover {
background-color: rgba(var(--accent-primary-rgb, 59, 130, 246), 0.1);
}
.smart-suggestion-item::before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: contain;
margin-right: 0.5rem;
flex-shrink: 0;
}
/* AI suggestion highlight */
.smart-suggestion-highlight {
font-weight: var(--font-weight-semibold, 600);
color: var(--accent-primary, #3b82f6);
}
/* Helper for hiding elements */
.hidden {
display: none !important;
}
/* Animation for feedback elements */
@keyframes smartFadeIn {
0% { opacity: 0; transform: translateY(-5px); }
100% { opacity: 1; transform: translateY(0); }
}
/* Focus styles */
.smart-error:focus {
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}
.smart-valid:focus {
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}
/* Processing state */
.smart-processing {
position: relative;
pointer-events: none;
}
.smart-processing::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(90deg,
rgba(var(--accent-primary-rgb, 59, 130, 246), 0.1),
rgba(var(--accent-primary-rgb, 59, 130, 246), 0.2),
rgba(var(--accent-primary-rgb, 59, 130, 246), 0.1)
);
background-size: 200% 100%;
animation: smartProcessing 1.5s infinite;
border-radius: inherit;
}
@keyframes smartProcessing {
0% { background-position: 100% 0; }
100% { background-position: -100% 0; }
}
/* Theme-specific styles */
/* Cyberpunk theme */
.theme-cyberpunk .smart-error-message::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff00ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}
.theme-cyberpunk .smart-error {
border-color: #ff00ff !important;
box-shadow: 0 0 0 1px #ff00ff !important;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff00ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}
.theme-cyberpunk .smart-suggestion-item::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff00ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'%3E%3C/path%3E%3C/svg%3E");
}
/* Matrix theme */
.theme-matrix .smart-error-message::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ff00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}
.theme-matrix .smart-error {
border-color: #00ff00 !important;
box-shadow: 0 0 0 1px #00ff00 !important;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ff00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}
.theme-matrix .smart-suggestion-item::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ff00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'%3E%3C/path%3E%3C/svg%3E");
}
/* Midnight theme */
.theme-midnight .smart-suggestion-item:hover {
background-color: rgba(59, 130, 246, 0.2);
}
/* Responsive adjustments */
@media (max-width: 640px) {
.smart-error-message {
font-size: 0.75rem;
}
.smart-suggestions-list {
padding: 0.25rem;
}
.smart-suggestion-item {
padding: 0.375rem;
}
}
/* High-contrast accessibility enhancements */
@media (prefers-contrast: more) {
.smart-error {
border-width: 2px !important;
}
.smart-valid {
border-width: 2px !important;
}
.smart-error-message {
font-weight: bold;
}
.smart-suggestion-item {
border: 1px solid currentColor;
}
}
/* Reduced motion settings */
@media (prefers-reduced-motion: reduce) {
.smart-error,
.smart-valid,
.smart-suggestion-item {
transition: none !important;
}
.smart-error-message,
.smart-suggestions-list {
animation: none !important;
}
} |