Spaces:
Running
Running
:root { | |
--error-color: #ef4444; | |
--error-bg: rgba(239, 68, 68, 0.1); | |
--error-border: rgba(239, 68, 68, 0.3); | |
--warning-color: #f59e0b; | |
--warning-bg: rgba(245, 158, 11, 0.1); | |
--warning-border: rgba(245, 158, 11, 0.3); | |
--success-color: #10b981; | |
--success-bg: rgba(16, 185, 129, 0.1); | |
--success-border: rgba(16, 185, 129, 0.3); | |
--info-color: #3b82f6; | |
--info-bg: rgba(59, 130, 246, 0.1); | |
--info-border: rgba(59, 130, 246, 0.3); | |
} | |
.notification-container { | |
position: fixed; | |
top: 20px; | |
right: 20px; | |
width: 100%; | |
max-width: 400px; | |
z-index: 1000; | |
display: flex; | |
flex-direction: column-reverse; | |
gap: 10px; | |
overflow: hidden; | |
} | |
.notification { | |
position: relative; | |
display: flex; | |
align-items: center; | |
padding: 16px; | |
border-radius: var(--border-radius); | |
box-shadow: var(--shadow); | |
animation: slideIn 0.3s ease forwards; | |
transform: translateX(120%); | |
opacity: 0; | |
} | |
@keyframes slideIn { | |
to { | |
transform: translateX(0); | |
opacity: 1; | |
} | |
} | |
@keyframes slideOut { | |
from { | |
transform: translateX(0); | |
opacity: 1; | |
} | |
to { | |
transform: translateX(120%); | |
opacity: 0; | |
} | |
} | |
.notification.hide { | |
animation: slideOut 0.3s ease forwards; | |
} | |
.notification-icon { | |
flex-shrink: 0; | |
width: 24px; | |
height: 24px; | |
margin-right: 12px; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
.notification-content { | |
flex-grow: 1; | |
} | |
.notification-title { | |
font-weight: 600; | |
margin-bottom: 4px; | |
font-size: 1rem; | |
text-transform: capitalize; | |
} | |
.notification-message { | |
font-size: 0.875rem; | |
margin: 0; | |
} | |
.notification-close { | |
position: absolute; | |
width: 20px; | |
height: 20px; | |
top: 0; | |
right: 0; | |
cursor: pointer; | |
opacity: 0.7; | |
transition: opacity 0.2s ease; | |
background: none; | |
border: none; | |
padding: 0; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
color: white; | |
} | |
.notification-close:hover { | |
opacity: 1; | |
} | |
.notification-error { | |
background-color: var(--error-bg); | |
border-left: 4px solid var(--error-color); | |
} | |
.notification-error .notification-icon, | |
.notification-error .notification-title { | |
color: var(--error-color); | |
} | |
.notification-warning { | |
background-color: var(--warning-bg); | |
border-left: 4px solid var(--warning-color); | |
} | |
.notification-warning .notification-icon, | |
.notification-warning .notification-title { | |
color: var(--warning-color); | |
} | |
.notification-success { | |
background-color: var(--success-bg); | |
border-left: 4px solid var(--success-color); | |
} | |
.notification-success .notification-icon, | |
.notification-success .notification-title { | |
color: var(--success-color); | |
} | |
.notification-info { | |
background-color: var(--info-bg); | |
border-left: 4px solid var(--info-color); | |
} | |
.notification-info .notification-icon, | |
.notification-info .notification-title { | |
color: var(--info-color); | |
} | |
/* Responsive Styles */ | |
@media (max-width: 768px) { | |
.notification-container { | |
top: 10px; | |
right: 10px; | |
left: 10px; | |
width: auto; | |
} | |
} |