/* Notification Bell Icon - Plant Theme */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    color: #ffffff;
    transition: all 0.3s ease;
    padding: 8px;
    background: transparent;
    z-index: 99998;
}

.notification-bell:hover {
    color: #d4edda;
    transform: scale(1.1);
}

.notification-bell .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    padding: 0.3em 0.5em;
    border-radius: 10px;
    background: #dc3545;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 99998;
}

/* Notification Dropdown - Plant Theme */
.notification-dropdown {
    position: fixed !important;
    top: 60px !important;
    right: 60px !important;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(25, 135, 84, 0.2);
    border: 2px solid #198754;
    z-index: 99999;
    display: none;
    margin-top: 10px;
}

/* Sidebar notification dropdown positioning - DESKTOP ONLY */
@media (min-width: 769px) {
    .sidebar .notification-dropdown,
    #sidebarNotificationDropdown {
        position: fixed !important;
        left: 240px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        right: auto !important;
        margin-top: 0 !important;
        max-height: 70vh !important;
        z-index: 99999 !important;
    }
    
    .sidebar .notification-dropdown.show,
    #sidebarNotificationDropdown.show {
        display: block !important;
        animation: none !important;
        transform: translateY(-50%) !important;
        pointer-events: auto;
        z-index: 99999 !important;
    }
}

.notification-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.notification-header {
    padding: 15px 20px;
    border-bottom: 2px solid #e7f5ec;
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 99999;
    position: relative;
}

.notification-header h6 {
    margin: 0;
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
}

.mark-all-read,
.delete-all-notifications {
    font-size: 0.95rem;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mark-all-read:hover,
.delete-all-notifications:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    text-decoration: none;
    transform: scale(1.05);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 99999;
    position: relative;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Custom scrollbar for notification list */
.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #198754;
    border-radius: 10px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: #146c43;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 12px;
    z-index: 99999;
    position: relative;
}

/* Notification checkbox for bulk delete */
.notification-checkbox {
    display: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    margin-top: 12px;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.notification-dropdown.delete-mode .notification-checkbox {
    display: block;
    opacity: 1;
    transform: scale(1);
}

/* Select all checkbox in header */
.select-all-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.notification-dropdown.delete-mode .select-all-checkbox {
    opacity: 1;
    transform: scale(1);
}

.notification-dropdown.delete-mode .notification-item {
    cursor: default;
    transition: padding-left 0.5s ease;
}

/* Animate notification items when entering delete mode */
.notification-item {
    transition: all 0.5s ease;
}

.notification-dropdown.delete-mode .notification-item {
    animation: slideInCheckbox 0.5s ease;
}

@keyframes slideInCheckbox {
    from {
        padding-left: 15px;
    }
    to {
        padding-left: 20px;
    }
}

/* Animate notification items when exiting delete mode */
.notification-dropdown:not(.delete-mode) .notification-item {
    animation: slideOutCheckbox 0.5s ease;
}

@keyframes slideOutCheckbox {
    from {
        padding-left: 20px;
    }
    to {
        padding-left: 15px;
    }
}

/* Hide normal actions in delete mode */
.notification-dropdown.delete-mode .mark-all-read,
.notification-dropdown.delete-mode .delete-all-notifications {
    display: none !important;
}

/* Show delete mode actions */
.delete-mode-actions {
    display: none;
    gap: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.notification-dropdown.delete-mode .delete-mode-actions {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.cancel-delete-btn,
.confirm-delete-btn {
    font-size: 0.75rem;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.cancel-delete-btn:hover,
.confirm-delete-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    text-decoration: none;
    transform: scale(1.05);
}

.cancel-delete-btn i,
.confirm-delete-btn i {
    font-size: 0.75rem;
}

.notification-item:hover {
    background: linear-gradient(90deg, #f8fdf9 0%, #e7f5ec 100%);
}

.notification-item.unread {
    background: linear-gradient(90deg, #e7f5ec 0%, #d1f0dd 100%);
    border-left: 4px solid #198754;
}

.notification-item.unread:hover {
    background: linear-gradient(90deg, #d1f0dd 0%, #c3ecd0 100%);
}

.notification-icon {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.notification-icon.success {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: #ffffff;
}

.notification-icon.info {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    color: #ffffff;
}

.notification-icon.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #ffffff;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #198754;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 0.8rem;
    color: #495057;
    margin-bottom: 4px;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.notification-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.notification-footer {
    padding: 12px 20px;
    border-top: 2px solid #e7f5ec;
    text-align: center;
    background: #f8fdf9;
    border-radius: 0 0 10px 10px;
}

.notification-footer a {
    font-size: 0.875rem;
    color: #198754;
    text-decoration: none;
    font-weight: 500;
}

.notification-footer a:hover {
    color: #146c43;
    text-decoration: underline;
}

.no-notifications {
    padding: 50px 20px;
    text-align: center;
    color: #6c757d;
}

.no-notifications i {
    font-size: 3.5rem;
    margin-bottom: 15px;
    opacity: 0.3;
    color: #198754;
}

/* Toast Notifications (popup on right side) - Plant Theme */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    max-width: 350px;
}

.notification-toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(25, 135, 84, 0.25);
    border-left: 4px solid #198754;
    margin-bottom: 15px;
    padding: 15px;
    display: flex;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 99999;
}

.notification-toast:hover {
    transform: translateX(-5px);
    box-shadow: 0 12px 32px rgba(25, 135, 84, 0.35);
}

.notification-toast.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Override sidebar notification dropdown positioning on mobile */
    .sidebar .notification-dropdown,
    #sidebarNotificationDropdown {
        position: fixed !important;
        left: 10px !important;
        right: auto !important;
        top: auto !important;
        bottom: 180px !important;
        transform: none !important;
        width: calc(200px - 20px) !important;
        max-width: calc(200px - 20px) !important;
        max-height: 300px !important;
        margin-top: 0 !important;
        z-index: 2002 !important;
    }
    
    .sidebar .notification-dropdown.show,
    #sidebarNotificationDropdown.show {
        transform: none !important;
    }
    
    .notification-dropdown {
        width: auto !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        border-radius: 8px;
    }
    
    .notification-header {
        padding: 10px 12px;
        border-radius: 6px 6px 0 0;
    }
    
    /* Hide "Notifications" text on mobile, keep only bell icon */
    .notification-header h6 .notification-text {
        display: none;
    }
    
    /* Keep the bell icon visible at normal size */
    .notification-header h6 i.fa-bell {
        font-size: 1.1rem !important;
        margin-right: 0 !important;
    }
    
    .notification-header h6 {
        margin: 0;
        display: flex;
        align-items: center;
    }
    
    .mark-all-read,
    .delete-all-notifications {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    /* Smaller delete mode buttons on mobile */
    .cancel-delete-btn,
    .confirm-delete-btn {
        font-size: 0.65rem !important;
        padding: 3px 6px !important;
        white-space: nowrap;
    }
    
    .cancel-delete-btn i,
    .confirm-delete-btn i {
        font-size: 0.65rem !important;
    }
    
    .notification-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .notification-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .notification-content {
        min-width: 0;
    }
    
    .notification-title {
        font-size: 0.8rem;
    }
    
    .notification-message {
        font-size: 0.7rem;
        line-height: 1.3;
    }
    
    .notification-time {
        font-size: 0.65rem;
    }
    
    .notification-list {
        max-height: 250px;
        scroll-behavior: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .notification-footer {
        padding: 8px 12px;
    }
    
    .notification-footer a {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .notification-dropdown {
        width: 280px !important;
        max-width: 280px !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        max-height: 350px;
        border-radius: 6px;
    }
    
    .notification-header {
        padding: 8px 10px;
        border-radius: 4px 4px 0 0;
    }
    
    .notification-header h6 {
        font-size: 0.8rem;
    }
    
    .mark-all-read,
    .delete-all-notifications {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
    
    .notification-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .notification-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .notification-title {
        font-size: 0.75rem;
    }
    
    .notification-message {
        font-size: 0.65rem;
        line-height: 1.2;
        max-height: 2.4em;
    }
    
    .notification-time {
        font-size: 0.6rem;
    }
    
    .notification-list {
        max-height: 200px;
        scroll-behavior: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .notification-footer {
        padding: 6px 10px;
    }
    
    .notification-footer a {
        font-size: 0.75rem;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
