#popup-container {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    pointer-events: none;
    padding: 1rem;
    max-width: 400px;
    width: 100%;
}

@media (max-width: 768px) {
    #popup-container {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        bottom: auto;
        padding: 0;
        max-width: none;
        width: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .popup-notification {
        max-width: 100%;
        transform: scale(0.95);
    }
    
    .popup-notification.show {
        transform: scale(1);
    }
    
    .popup-notification.closing {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Popup notification */
.popup-notification {
    pointer-events: auto;
    max-width: 350px;
    width: 100%;
    background: #374151;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    border-left: 4px solid;
    padding: 1rem;
    margin-bottom: 0.5rem;
    transform: translateY(0.5rem);
    transition: all 0.3s ease-out;
    opacity: 0;
    border: 1px solid #4b5563;
}

.popup-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.popup-notification.closing {
    opacity: 0;
    transform: translateX(100%);
}

/* Border color for notifications */
.popup-notification.success {
    border-left-color: #6b7280;
}

.popup-notification.error {
    border-left-color: #6b7280;
}

.popup-notification.warning {
    border-left-color: #6b7280;
}

.popup-notification.info {
    border-left-color: #6b7280;
}

.popup-notification.question {
    border-left-color: #6b7280;
}

/* Popup content */
.popup-content {
    display: flex;
    align-items: flex-start;
}

.popup-icon {
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.popup-text {
    flex: 1;
    min-width: 0;
}

.popup-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #f3f4f6;
    margin: 0;
}

.popup-message {
    font-size: 0.875rem;
    color: #d1d5db;
    margin: 0.25rem 0 0 0;
}

.popup-close {
    margin-left: 1rem;
    flex-shrink: 0;
    display: flex;
}

.popup-close button {
    background: transparent;
    border-radius: 0.375rem;
    border: none;
    padding: 0.25rem;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.popup-close button:hover {
    color: #9ca3af;
}

/* Modals (confirmation/alert) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    overflow-y: auto;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    background: rgba(0, 0, 0, 0.3);
}

.modal-overlay.show {
    opacity: 1;
}

.modal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease-out;
}

.modal-content {
    background: #374151;
    border-radius: 0.5rem;
    text-align: left;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: all 0.3s ease-out;
    max-width: 32rem;
    width: 100%;
    opacity: 0;
    border: 1px solid #4b5563;
}

.modal-overlay.show .modal-content {
    opacity: 1;
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
}

.modal-icon-container {
    display: flex;
    align-items: flex-start;
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    width: 3rem;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
}

/* Colors for modal icons */
.modal-icon.success {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.modal-icon.error {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.modal-icon.warning {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.modal-icon.info {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.modal-icon.question {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.modal-text {
    flex: 1;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #f3f4f6;
    margin: 0 0 0.5rem 0;
}

.modal-message {
    font-size: 0.875rem;
    color: #d1d5db;
    margin: 0;
}

.modal-footer {
    background: #1f2937;
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid #4b5563;
}

.modal-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* Animations for the error messages in modals */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
}

.modal-button {
    display: inline-flex;
    justify-content: center;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.modal-button.primary {
    background: #4b5563;
    color: #f3f4f6;
    border-color: #4b5563;
}

.modal-button.primary:hover {
    background: #6b7280;
    border-color: #6b7280;
}

.modal-button.secondary {
    background: transparent;
    color: #9ca3af;
    border-color: #374151;
}

.modal-button.secondary:hover {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(1rem) translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
    to {
        opacity: 0;
        transform: translateY(1rem) translateX(100%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 640px) {
    #popup-container {
        max-width: 100%;
        padding: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }
    
    .popup-notification {
        max-width: 100%;
    }
    
    .modal-overlay {
        padding: 0;
    }
    
    .modal-container {
        padding: 0.5rem;
        min-height: 100vh;
    }
    
    .modal-content {
        max-width: calc(100vw - 1rem);
        margin: 0;
        width: calc(100vw - 1rem);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-button {
        width: 100%;
    }
}
