/* Email and Submission Notification System Styles */

/* Email and Submission Badge Styles */
.email-badge, .email-unread-badge, .unread-count, 
.submission-badge, .submission-unread-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -8px;
    right: -8px;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
    border: 2px solid #fff;
    z-index: 10;
}

/* Submission-specific badge styling */
.submission-badge, .submission-unread-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.4);
}

/* Badge animation when it appears */
.badge-notification {
    animation: badgeAppear 0.3s ease-out;
}

@keyframes badgeAppear {
    0% {
        transform: scale(0.3) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(-10deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Email icon with notification indicator */
.email-nav-icon {
    position: relative;
    transition: all 0.3s ease;
}

.email-nav-icon.has-notifications {
    color: #007bff;
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Email notification toast styles */
.email-notification-toast {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.email-notification-toast .btn-close {
    color: white;
    opacity: 0.8;
}

.email-notification-toast .btn-close:hover {
    opacity: 1;
}

/* Submission notification toast styles */
.submission-notification-toast {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.submission-notification-toast .btn-close {
    color: white;
    opacity: 0.8;
}

.submission-notification-toast .btn-close:hover {
    opacity: 1;
}

/* Sync status indicator */
#email-sync-status {
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Email count in navigation */
.navbar .email-badge {
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
}

/* Sidebar email badge */
.sidebar .email-badge {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    top: 0;
    right: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .email-badge, .email-unread-badge, .unread-count {
        font-size: 0.7rem;
        min-width: 18px;
        height: 18px;
        top: -6px;
        right: -6px;
    }
    
    #email-sync-status {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.8rem;
    }
}

/* Connection status indicator */
.email-connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.email-connection-status.connected {
    background-color: #28a745;
    color: white;
}

.email-connection-status.connecting {
    background-color: #ffc107;
    color: #212529;
}

.email-connection-status.disconnected {
    background-color: #dc3545;
    color: white;
}

/* Hide connection status by default */
.email-connection-status {
    display: none;
}

/* Show connection status on email pages */
.email-page .email-connection-status {
    display: block;
}

/* Real-time notification styles */
.realtime-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1060;
    max-width: 350px;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.realtime-notification.notification-new-email {
    border-left: 4px solid #007bff;
}

.realtime-notification.notification-sync {
    border-left: 4px solid #28a745;
}

.realtime-notification.notification-error {
    border-left: 4px solid #dc3545;
}

/* Enhanced email and submission icon effects */
.fa-envelope.has-notifications,
.fa-inbox.has-notifications {
    position: relative;
}

.fa-envelope.has-notifications::after,
.fa-inbox.has-notifications::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    border: 2px solid white;
    animation: notificationDot 2s infinite;
}

/* Submission-specific icon styling */
.fa-inbox.has-notifications::after {
    background: #28a745;
}

/* Unread submission card styling */
.unread-submission {
    border-left: 4px solid #28a745 !important;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.1);
}

.unread-submission .list-card-title {
    font-weight: 600;
}

.unread-submission::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    z-index: 5;
}

@keyframes notificationDot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .email-badge, .email-unread-badge, .unread-count {
        border-color: #333;
    }
    
    #email-sync-status {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .fa-envelope.has-notifications::after {
        border-color: #333;
    }
}
