/**
 * Styles for real-time test drive notifications
 */

/* Notification Container */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    background: #417690;
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background: #2c5aa0;
    transform: scale(1.05);
}

.notification-bell.disconnected {
    background: #dc3545;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.notification-bell i {
    font-size: 20px;
}

/* Notification Count Badge */
.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
}

.notification-count.hidden {
    display: none;
}

/* Notification Panel */
.notification-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 400px;
    max-height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification-panel:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
}

.notification-panel.hidden {
    display: none;
}

/* Notification Header */
.notification-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

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

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e9ecef;
    color: #333;
}

/* Notification List */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.no-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Notification Item */
.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

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

.notification-item.unread {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.notification-item.read {
    opacity: 0.7;
}

.notification-content {
    margin-bottom: 10px;
}

.notification-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-message {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.notification-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.detail-item {
    font-size: 12px;
    color: #888;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.notification-time {
    font-size: 11px;
    color: #999;
}

.notification-actions {
    display: flex;
    gap: 8px;
}

.btn-view, .btn-mark-read {
    background: #417690;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-view:hover, .btn-mark-read:hover {
    background: #2c5aa0;
}

.btn-mark-read {
    background: #28a745;
}

.btn-mark-read:hover {
    background: #218838;
}

/* Enhanced Toast Notifications */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #417690;
    margin-bottom: 10px;
    z-index: 10000;
    transition: transform 0.3s ease;
}

.notification-toast.enhanced {
    width: 400px;
    border-left: 4px solid #28a745;
}

.toast-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #e9ecef;
}

.toast-icon {
    color: #28a745;
    margin-right: 8px;
    font-size: 16px;
}

.toast-title {
    flex: 1;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.toast-content {
    padding: 16px;
}

.toast-message {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.toast-details {
    margin: 12px 0;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.detail-row i {
    width: 16px;
    margin-right: 8px;
    color: #666;
}

.detail-row span {
    color: #555;
}

.toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.toast-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.toast-btn.primary {
    background: #417690;
    color: white;
}

.toast-btn.primary:hover {
    background: #2c5aa0;
}

.toast-btn.secondary {
    background: #6c757d;
    color: white;
}

.toast-btn.secondary:hover {
    background: #545b62;
}

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

.toast-content {
    margin-right: 30px;
}

.toast-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.toast-details {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    #notification-container {
        top: 10px;
        right: 10px;
    }

    .notification-panel {
        width: 320px;
        max-width: calc(100vw - 20px);
    }

    .notification-toast {
        width: 300px;
        max-width: calc(100vw - 20px);
        right: 10px;
    }
}

/* Integration with Django Admin */
.admin #notification-container {
    top: 80px; /* Account for admin header */
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .notification-panel {
        background: #2b2b2b;
        border-color: #444;
        color: #e0e0e0;
    }

    .notification-header {
        background: #333;
        border-color: #444;
    }

    .notification-header h3 {
        color: #e0e0e0;
    }

    .notification-item {
        border-color: #444;
    }

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

    .notification-item.unread {
        background: #3d3d00;
        border-left-color: #ffc107;
    }

    .notification-toast {
        background: #2b2b2b;
        color: #e0e0e0;
    }

    .toast-header {
        background: #333;
        border-color: #444;
    }

    .toast-close:hover {
        background: #444;
        color: #e0e0e0;
    }
}

/* Refresh Indicators */
.refresh-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.refresh-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.refresh-content i {
    font-size: 16px;
    color: #17a2b8;
}

.refresh-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #17a2b8;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 10001;
    animation: slideUp 0.3s ease;
}

.refresh-notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Enhanced notification bell animation */
.notification-bell.new-notification {
    animation: bellShake 0.5s ease-in-out;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}
