Spaces:
Build error
Build error
File size: 7,224 Bytes
cfb75f4 | 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 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | /* static/css/style.css */
:root {
--font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--background-color: #f8f9fa; /* Very light grey */
--card-background-color: #ffffff;
--text-color: #343a40; /* Dark grey */
--subtle-text-color: #6c757d; /* Lighter grey */
--border-color: #dee2e6; /* Light border */
--primary-color: #4a90e2; /* Example accent blue */
--primary-color-hover: #357abd;
--secondary-color: #e9ecef; /* Light grey for secondary buttons */
--secondary-color-hover: #ced4da;
--error-color: #dc3545; /* Red for errors */
--border-radius: 8px;
--box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
--container-max-width: 800px;
}
body {
font-family: var(--font-family-sans);
background-color: var(--background-color);
color: var(--text-color);
line-height: 1.6;
margin: 0;
padding: 20px;
}
.container {
max-width: var(--container-max-width);
margin: 20px auto;
padding: 0 15px;
}
header {
text-align: center;
margin-bottom: 40px;
}
h1 {
font-weight: 700;
margin-bottom: 0.5rem;
}
.subtitle {
color: var(--subtle-text-color);
font-size: 1.1rem;
}
main {
display: flex;
flex-direction: column;
gap: 30px; /* Space between sections */
}
.card {
background-color: var(--card-background-color);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
padding: 25px;
}
h2, h3, h4 {
margin-top: 0;
margin-bottom: 1rem;
font-weight: 500;
}
/* --- Upload Section --- */
#upload-form {
display: flex;
flex-wrap: wrap; /* Allow wrapping on small screens */
align-items: center;
gap: 15px;
}
.file-label {
display: inline-flex; /* Use flex for icon alignment */
align-items: center;
padding: 10px 15px;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
cursor: pointer;
background-color: var(--card-background-color);
transition: background-color 0.2s ease;
}
.file-label:hover {
background-color: #f1f3f5; /* Slightly darker on hover */
}
#photo-input {
/* Hide the default file input */
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
}
#file-name-display {
color: var(--subtle-text-color);
font-size: 0.9rem;
flex-grow: 1; /* Take up remaining space */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.icon {
width: 1.2em; /* Adjust icon size */
height: 1.2em;
margin-right: 8px;
vertical-align: middle; /* Align icon better with text */
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 10px 20px;
border: none;
border-radius: var(--border-radius);
font-weight: 500;
cursor: pointer;
transition: background-color 0.2s ease, box-shadow 0.2s ease;
text-decoration: none; /* Remove underline if used as link */
white-space: nowrap; /* Prevent wrapping */
}
.button .icon {
margin-right: 6px;
}
.button span { /* Ensure span inside button aligns well */
line-height: 1;
}
.primary-button {
background-color: var(--primary-color);
color: white;
}
.primary-button:hover {
background-color: var(--primary-color-hover);
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.secondary-button {
background-color: var(--secondary-color);
color: var(--text-color);
border: 1px solid var(--border-color);
}
.secondary-button:hover {
background-color: var(--secondary-color-hover);
}
.error-text {
color: var(--error-color);
font-size: 0.9rem;
margin-top: 10px;
}
/* --- Results Section --- */
#result-image {
display: block;
max-width: 100%;
height: auto;
margin-top: 15px;
margin-bottom: 20px;
border-radius: var(--border-radius);
border: 1px solid var(--border-color);
}
.button-group {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.button-group .button { /* Style buttons within the group */
background-color: var(--secondary-color);
color: var(--text-color);
border: 1px solid var(--border-color);
}
.button-group .button:hover {
background-color: var(--secondary-color-hover);
}
/* --- Bird Info Section --- */
.bird-info-header {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 20px;
}
#bird-example-image {
width: 100px;
height: 100px;
object-fit: cover; /* Cover the area, might crop */
border-radius: var(--border-radius);
border: 1px solid var(--border-color);
flex-shrink: 0; /* Prevent image from shrinking */
}
#bird-info-area h3 {
margin-bottom: 0; /* Remove bottom margin if next to image */
}
.bird-info-details p {
margin-bottom: 0.8rem;
}
.bird-info-details strong {
color: var(--text-color); /* Ensure strong text is dark */
}
.audio-player {
margin-top: 15px;
}
#bird-audio {
width: 100%; /* Make audio player responsive */
margin-top: 5px;
}
#chat-button { /* Style the chat button specifically */
margin-top: 20px;
}
/* --- Chat Interface --- */
#chat-history {
height: 250px;
overflow-y: auto;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
padding: 15px;
margin-bottom: 15px;
background-color: #f8f9fa; /* Slightly different background */
}
#chat-history p {
margin-bottom: 10px;
word-wrap: break-word; /* Break long words */
}
#chat-history p strong { /* Style sender name */
color: var(--primary-color); /* Use accent color for sender */
margin-right: 5px;
}
#chat-history p:last-child {
margin-bottom: 0;
}
.chat-input-area {
display: flex;
gap: 10px;
}
#chat-input {
flex-grow: 1;
padding: 10px 15px;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
font-size: 1rem;
}
#chat-input:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2); /* Subtle focus ring */
}
#send-chat-button .icon {
margin-right: 0; /* No text, so no margin needed */
}
#send-chat-button span { /* Hide text on send button if only icon is desired */
display: none;
}
/* --- Loading Indicators --- */
.loading {
display: flex;
align-items: center;
gap: 10px;
color: var(--subtle-text-color);
margin-top: 15px;
font-size: 0.9rem;
}
.spinner {
width: 20px;
height: 20px;
border: 2px solid var(--border-color);
border-top-color: var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
}
.small-spinner {
width: 16px;
height: 16px;
border-width: 2px;
}
@keyframes spin {
to { transform: rotate(360deg); }
} |