
/* Base styles for all notifications */
.notification-container {
    position: fixed; /* Default position for body containers */
    display: none;
    font-family: Arial, sans-serif;
    z-index: 9900;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: #fff;
    max-height: 95vh;
}

/* Style for custom containers */
div:not(body) > .notification-container {
    position: absolute; /* Override for custom containers */
}

.notification-container.notification-dragging {
    opacity: 0.9;
    transition: none;
}

.notification-container.notification-resizing {
    opacity: 0.95;
    transition: none;
}

/* Notification header */
.notification-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
    font-weight: bold;
    user-select: none;
    position:sticky;
    top:0;
    z-index:1020;
}

/* Make header cursor indicate draggable for draggable notifications */
.notification-container:not(.notification-banner) .notification-draggable {
    cursor: move;
}


/* Notification close button */
.notification-close {
    /*class used to capture the click event of the notification close button and close the notification*/
}
.notification-close-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.notification-close-button:hover {
    opacity: 1;
}

/* Notification body */
.notification-body {
    padding: 15px;
    overflow-y: auto;
    /*max-height: 400px;*/
    min-height: 50px;
}

/* Notification footer */
.notification-footer {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position:sticky;
    bottom:0;
    z-index:1020;
}

/* Footer content */
.notification-footer-content {
    flex-grow: 1;
    margin-bottom: 5px;
}

/* Footer buttons container */
.notification-footer-buttons {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

/* Allow some buttons to float left */
.notification-footer-buttons .float-start,
.notification-footer-buttons .float-left {
    margin-right: auto;
}

/* Allow some buttons to float right */
.notification-footer-buttons .float-end,
.notification-footer-buttons .float-right {
    margin-left: auto;
}

/* Notification buttons */
.notification-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.notification-cancel {
    background-color: #f5f5f5;
    color: #333;
}

.notification-cancel:hover {
    background-color: #e0e0e0;
}

.notification-btn-primary {
    background-color: #007bff;
    color: white;
}

.notification-btn-primary:hover {
    background-color: #0069d9;
}

.notification-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.notification-btn-secondary:hover {
    background-color: #5a6268;
}

.notification-btn-success {
    background-color: #28a745;
    color: white;
}

.notification-btn-success:hover {
    background-color: #218838;
}

.notification-btn-danger {
    background-color: #dc3545;
    color: white;
}

.notification-btn-danger:hover {
    background-color: #c82333;
}

.notification-btn-info {
    background-color: #17a2b8;
    color: white;
}

.notification-btn-info:hover {
    background-color: #138496;
}

.notification-btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.notification-btn-warning:hover {
    background-color: #e0a800;
}

.notification-btn-light {
    background-color: #f8f9fa;
    color: #212529;
}

.notification-btn-light:hover {
    background-color: #e2e6ea;
}

.notification-btn-dark {
    background-color: #343a40;
    color: white;
}

.notification-btn-dark:hover {
    background-color: #23272b;
}

/* Bootstrap-like utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-weight-bold { font-weight: bold; }
.font-italic { font-style: italic; }

/* Resize handle */
.notification-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 1031;
}

.notification-resize-handle::before {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 0;
    height: 0;
    border-bottom: 10px solid rgba(0, 0, 0, 0.3);
    border-left: 10px solid transparent;
}

.notification-resize-handle:hover::before {
    border-bottom-color: rgba(0, 0, 0, 0.5);
}

/* Modal backdrop */
.notification-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

/* Backdrop for custom containers */
div:not(body) > .notification-backdrop {
    position: absolute;
}

/* Container that has notifications needs to have positioning context */
div:has(> .notification-container) {
    position: relative;
}

/* Popup specific styles */
.notification-popup,
.notification-popupmodal {
    min-width: 300px;
    /*max-width: 600px;*/
}

/* Specific styles for popupmodal */
.notification-popupmodal {
    z-index: 10000; /* Higher z-index to appear above other notifications */
}

/* For popups in small containers, make sure they fit */
div:not(body) > .notification-popup,
div:not(body) > .notification-popupmodal {
    max-width: 95%;
    max-height: 95%;
}

/* Toast specific styles */
.notification-toast {
    min-width: 250px;
    max-width: 350px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
    touch-action: pan-y;
}

/* For toasts in small containers, make sure they fit */
div:not(body) > .notification-toast {
    max-width: 80%;
}

/* Toast transitions for swipe gestures */
.notification-toast.swiping {
    transition: transform 0.1s linear;
}

.notification-toast.swipe-out {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Progress bar container for toasts */
.notification-toast .notification-progress-container {
    margin-top: 0;
    border-radius: 0 0 4px 4px;
}

/* Adjust progress bar position for different notification types */
.notification-popup .notification-progress-container,
.notification-popupmodal .notification-progress-container {
    margin-top: -4px; /* Connect with body without gap */
}

/* Progress pause button for toasts */
.notification-toast .notification-progress-pause {
    z-index: 2;
}

/* Make sure toast content can be tapped/clicked */
.notification-toast .notification-body {
    pointer-events: auto;
}

/* Queue of toasts should animate smoothly when repositioning */
.notification-toast {
    transition: top 0.3s ease, bottom 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* Banner specific styles */
.notification-banner {
    width: 100%;
    border-radius: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: top 0.3s ease, bottom 0.3s ease, left 0.3s ease, right 0.3s ease;
    will-change: transform;
}

/* Left and right banner specific styles */
.notification-banner[style*="left: 0"][style*="bottom: 0"]:not([style*="right: 0"]) {
    width: auto;
    height: 100%;
    max-width: 300px;
    border-radius: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.notification-banner[style*="right: 0"][style*="bottom: 0"]:not([style*="left: 0"]) {
    width: auto;
    height: 100%;
    max-width: 300px;
    border-radius: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* For vertical banners, make scrolling possible */
.notification-banner[style*="left: 0"][style*="bottom: 0"] .notification-body,
.notification-banner[style*="right: 0"][style*="bottom: 0"] .notification-body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Sticky banner styles */
.notification-banner.notification-sticky {
    position: fixed !important;
    z-index: 9995;
}

/* Ensure proper stacking of banners */
.notification-banner {
    z-index: 9990;
}

.notification-banner + .notification-banner {
    z-index: 9989;
}

/* Banner header styles */
.notification-banner .notification-header {
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Banner body styles */
.notification-banner .notification-body {
    padding: 10px 15px;
    max-height: none;
}

/* Banner footer styles */
.notification-banner .notification-footer {
    padding: 8px 15px;
}

/* Banner progress bar styles */
.notification-banner .notification-progress-container {
    height: 6px;
    margin-top: 0;
}

/* When multiple banners are stacked */
.notification-banner.notification-top + .notification-banner.notification-top {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.notification-banner.notification-bottom + .notification-banner.notification-bottom {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Slide-in specific styles */
.notification-slide-in {
    min-width: 250px;
    max-width: 350px;
    transition: all 0.3s ease;
    position: fixed;
    z-index: 9997;
}

/* For slide-ins in small containers, make sure they fit */
div:not(body) > .notification-slide-in {
    max-width: 80%;
    position: absolute;
}

/* Full size slide-in styles */
.notification-slide-in.slide-in-full-width {
    width: 100% !important;
    max-width: 100% !important;
}

.notification-slide-in.slide-in-full-height {
    height: 100% !important;
    max-height: 100% !important;
}

/* Add slide-in animation keyframes */
@keyframes slideInFromRight {
    0% { transform: translateX(100%); }
    100% { transform: translateX(0); }
}

@keyframes slideInFromLeft {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

@keyframes slideInFromTop {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

@keyframes slideInFromBottom {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
}

/* Slide-in transitions for different positions */
.notification-slide-in[style*="left"] {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
}

.notification-slide-in[style*="right"] {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
}

.notification-slide-in[style*="top"] {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: top 0.3s ease;
}

.notification-slide-in[style*="bottom"] {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: bottom 0.3s ease;
}

/* Tab styles for slide-in panels */
.notification-tab {
    position: fixed;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 9998;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s ease;
}

div:not(body) > .notification-tab {
    position: absolute;
}

/* Tab hover effect */
.notification-tab:hover {
    background-color: #0069d9;
}

/* Tab styles by notification mode */
.notification-info .notification-tab {
    background-color: #007bff;
}

.notification-success .notification-tab {
    background-color: #28a745;
}

.notification-warning .notification-tab {
    background-color: #ffc107;
    color: #333;
}

.notification-error .notification-tab {
    background-color: #dc3545;
}

/* Mode specific styles */
.notification-info .notification-header {
    background-color: #007bff;
    color: white;
}

.notification-success .notification-header {
    background-color: #28a745;
    color: white;
}

.notification-warning .notification-header {
    background-color: #ffc107;
    color: #333;
}

.notification-error .notification-header {
    background-color: #dc3545;
    color: white;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .notification-popup,
    .notification-toast,
    .notification-slide-in {
        max-width: 90vw;
    }
    
    .notification-body {
        max-height: 60vh;
    }
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes slideInTop {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes slideOutTop {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

@keyframes slideInBottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideOutBottom {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

/* Progress bar container */
.notification-progress-container {
    position: relative;
    width: 99%; /* Allow room for the resizer */
    height: 8px;
    background-color: #f0f0f0;
    overflow: hidden;
    border-radius: 0 0 4px 4px;
    display: flex;
    align-items: center;
    z-index:1032;
}

/* Progress bar */
.notification-progress-bar {
    position: absolute;
    height: 100%;
    width: 0%;
    background-color: #007bff;
    transition: width 0.1s linear;
    left: 0;
    top: 0;
}

/* Progress pause button */
.notification-progress-pause {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.notification-progress-pause:hover {
    opacity: 1;
}

/* Different colored progress bars based on notification mode */
.notification-info .notification-progress-bar {
    background-color: #007bff;
}

.notification-success .notification-progress-bar {
    background-color: #28a745;
}

.notification-warning .notification-progress-bar {
    background-color: #ffc107;
}

.notification-error .notification-progress-bar {
    background-color: #dc3545;
}

/* Minimize button */
.notification-minimize {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    margin-right: 4px;
}

.notification-minimize:hover {
    opacity: 1;
}

/* Notification controls container */
.notification-controls {
    display: flex;
    align-items: center;
}

/* Minimized notifications container */
.minimized-notifications-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    z-index: 9997;
    pointer-events: none;
}

/* Minimized notification */
.notification-container.notification-minimized {
    position: fixed;
    bottom: 0 !important;
    top: auto !important;
    height: 40px !important;
    min-height: 40px !important;
    width: 220px !important;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    display: flex !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transform: none !important;
}

.notification-container.notification-minimized .notification-header {
    padding: 8px 10px;
    width: 100%;
    cursor: move;
}

.notification-container.notification-minimized .notification-body,
.notification-container.notification-minimized .notification-footer,
.notification-container.notification-minimized .notification-resize-handle,
.notification-container.notification-minimized .notification-progress-container {
    display: none;
}

/* Transition for minimize/restore */
.notification-container {
    transition: width 0.3s ease, height 0.3s ease, left 0.3s ease, top 0.3s ease, bottom 0.3s ease;
} 