/* Notification System Styles */

/* Notification Permission Modal */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.notification-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-modal-title i {
    color: #3b82f6;
    font-size: 18px;
}

.notification-modal-body {
    padding: 24px;
}

.notification-modal-description {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #374151;
    line-height: 1.5;
}

.notification-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.notification-benefits-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: #4b5563;
}

.notification-benefits-list i {
    color: #10b981;
    font-size: 16px;
    flex-shrink: 0;
}

.notification-modal-note {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-modal-note i {
    color: #6b7280;
    font-size: 14px;
    flex-shrink: 0;
}

.notification-modal-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    flex-direction: column;
}

.btn-notification-primary,
.btn-notification-secondary,
.btn-notification-text {
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-notification-primary {
    background: #3b82f6;
    color: white;
}

.btn-notification-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-notification-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-notification-secondary:hover {
    background: #e5e7eb;
}

.btn-notification-text {
    background: none;
    color: #6b7280;
    padding: 8px;
}

.btn-notification-text:hover {
    color: #4b5563;
}

/* Notification Status Banner */
.notification-status-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 12px 16px;
    animation: bannerSlideDown 0.3s ease-out;
}

@keyframes bannerSlideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.notification-status-content {
    max-width: 1200px;
    margin: 0 auto;
}

.notification-status-item {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
}

#notification-status-granted {
    border-left-color: #10b981;
}

#notification-status-denied {
    border-left-color: #f59e0b;
}

#notification-status-unsupported {
    border-left-color: #6b7280;
}

.notification-status-icon {
    font-size: 16px;
    flex-shrink: 0;
}

#notification-status-granted .notification-status-icon {
    color: #10b981;
}

#notification-status-denied .notification-status-icon {
    color: #f59e0b;
}

#notification-status-unsupported .notification-status-icon {
    color: #6b7280;
}

.notification-status-text {
    flex: 1;
    font-size: 14px;
    color: #374151;
    margin-right: 12px;
}

.notification-status-link {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.notification-status-link:hover {
    color: #2563eb;
}

/* Notification Toggle Button */
.notification-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: #3b82f6;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
    z-index: 998;
}

.notification-toggle-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.notification-toggle-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

/* Notification Center */
.notification-center {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 997;
    display: flex;
    flex-direction: column;
    animation: centerSlideIn 0.3s ease-out;
}

@keyframes centerSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.notification-center-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-center-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-center-title i {
    color: #3b82f6;
    font-size: 16px;
}

.notification-count-badge {
    background: #ef4444;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.notification-center-controls {
    display: flex;
    gap: 4px;
}

.notification-control-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.notification-control-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.notification-center-body {
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
}

.notification-loading {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.notification-loading i {
    font-size: 20px;
    color: #3b82f6;
}

.notification-list {
    padding: 8px 0;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.notification-unread {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notification-icon--emergency {
    background: #fef2f2;
    color: #dc2626;
}

.notification-icon--pickup {
    background: #eff6ff;
    color: #3b82f6;
}

.notification-icon--schedule {
    background: #f0f9ff;
    color: #0ea5e9;
}

.notification-icon--academic {
    background: #f0fdf4;
    color: #16a34a;
}

.notification-icon--driver_location {
    background: #fefbef;
    color: #d97706;
}

.notification-icon--engagement {
    background: #fdf4ff;
    color: #a855f7;
}

.notification-content {
    flex: 1;
    min-width: 0;
    overflow: hidden; /* Ensure truncation works */
}

/* Action arrow for actionable notifications */
.notification-action-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    margin-left: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.notification-item:hover .notification-action-arrow {
    color: #3b82f6;
    transform: translateX(2px);
}

.notification-title,
.notification-subject {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    /* Single line truncation with ellipsis */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-body {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
    /* Multi-line truncation (max 3 lines) with ellipsis */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.notification-type {
    text-transform: capitalize;
}

.notification-actions {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.notification-mark-read {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.notification-mark-read:hover {
    background: #f3f4f6;
    color: #10b981;
}

.notification-empty {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

.notification-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.notification-empty h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
}

.notification-empty p {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

.notification-center-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
}

.notification-load-more-btn {
    width: 100%;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.notification-load-more-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .notification-center {
        right: 10px;
        left: 10px;
        width: auto;
        top: 70px;
    }
    
    .notification-toggle-btn {
        right: 15px;
        top: 15px;
        width: 44px;
        height: 44px;
    }
    
    .notification-status-banner {
        padding: 8px 12px;
    }
    
    .notification-modal-actions {
        flex-direction: column;
        gap: 8px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) and (prefers-color-scheme: light) {
    .notification-modal-content {
        background: #1f2937;
        color: white;
    }
    
    .notification-modal-title {
        color: white;
    }
    
    .notification-modal-description {
        color: #d1d5db;
    }
    
    .notification-benefits-list li {
        color: #9ca3af;
    }
    
    .notification-modal-note {
        background: #374151;
        color: #9ca3af;
    }
    
    .notification-center {
        background: #1f2937;
    }
    
    .notification-center-title {
        color: white;
    }
    
    .notification-item {
        border-bottom-color: #374151;
    }
    
    .notification-item:hover {
        background: #374151;
    }
    
    .notification-item.notification-unread {
        background: #1e3a8a;
    }
    
    .notification-title {
        color: white;
    }
    
    .notification-body {
        color: #d1d5db;
    }
    
    .notification-status-item {
        background: #1f2937;
        color: white;
    }
    
    .notification-status-text {
        color: #d1d5db;
    }
}

/* Animation for new notifications */
@keyframes notificationPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.notification-toggle-btn.notification-new {
    animation: notificationPulse 0.6s ease-in-out;
}

/* Focus styles for accessibility */
.notification-control-btn:focus,
.notification-mark-read:focus,
.btn-notification-primary:focus,
.btn-notification-secondary:focus,
.btn-notification-text:focus,
.notification-status-link:focus,
.notification-toggle-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .notification-modal {
        background-color: rgba(0, 0, 0, 0.9);
    }
    
    .notification-item {
        border-bottom: 2px solid #e5e7eb;
    }
    
    .notification-item.notification-unread {
        border-left-width: 4px;
    }
}