/* Logo preload optimization - prevent flash on page navigation */
.nav-brand-logo {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    object-fit: contain;
    display: block;
    /* Always visible - no opacity transitions that cause flash */
    opacity: 1 !important;
    /* Force hardware acceleration for smooth rendering */
    transform: translateZ(0);
    /* Prevent any layout shift */
    visibility: visible;
    /* Ensure image is rendered immediately */
    content-visibility: auto;
}

/* Reserve space for logo container to prevent layout shift */
#nav .flex-row.justify-start {
    min-width: 50px;
    min-height: 50px;
    position: relative;
}

/* Add background placeholder to prevent white flash */
#nav .flex-row.justify-start a {
    display: inline-block;
    background-color: transparent;
    min-width: 50px;
    min-height: 50px;
}

/* Past Messages Expander Styles */
.past-messages-expander {
    margin-top: 2rem;
}

.past-messages-toggle {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.2s ease;
    width: 100%;
    text-align: left;
}

.past-messages-toggle:hover {
    color: #8cc9f0;
}

.past-messages-toggle i {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.past-messages-content {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Global Status Notification Styles */
.status-notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    margin-top: 10%;
    margin-right: 10%;
    pointer-events: none;
}

.status-notification-badge .notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    border: 2px solid;
    border-color: #f7f7f7;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3);
}

body.dark .status-notification-badge .notification-dot {
    border-color: rgba(18, 18, 18, 0.95);
}

#nav a[href="/status"] {
    position: relative;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.status-notification-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    animation: slideInRight 0.3s ease;
    overflow: hidden;
}

body.dark .status-notification-popup {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.status-notification-popup.show {
    display: block;
}

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

.status-notification-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #fff5f5;
    border-bottom: 1px solid #ffe0e0;
}

body.dark .status-notification-popup-header {
    background: #3a1f1f;
    border-bottom-color: #4a2a2a;
}

.status-notification-popup-header h4 {
    margin: 0;
    color: #d32f2f;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark .status-notification-popup-header h4 {
    color: #ff6b6b;
}

.status-notification-popup-header i {
    font-size: 1.3rem;
}

.status-notification-popup-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
}

body.dark .status-notification-popup-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.status-notification-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

body.dark .status-notification-popup-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.status-notification-popup-content {
    padding: 1.5rem;
    margin-bottom: 0;
}

.status-notification-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid;
}

body.dark .status-notification-item {
    background: #1f1f1f;
}

.status-notification-item:last-child {
    margin-bottom: 0;
}

.status-notification-item.severity-high {
    border-left-color: #d32f2f;
    background: #fff5f5;
}

body.dark .status-notification-item.severity-high {
    background: #3a1f1f;
    border-left-color: #ff6b6b;
}

.status-notification-item.severity-medium {
    border-left-color: #f57c00;
    background: #fff8f0;
}

body.dark .status-notification-item.severity-medium {
    background: #3a2f1f;
    border-left-color: #ffa500;
}

.status-notification-item.severity-low {
    border-left-color: #fbc02d;
    background: #fffef5;
}

body.dark .status-notification-item.severity-low {
    background: #3a3a1f;
    border-left-color: #ffd700;
}

.status-notification-item-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark .status-notification-item-title {
    color: #fff;
}

.status-notification-item.severity-high .status-notification-item-title {
    color: #d32f2f;
}

body.dark .status-notification-item.severity-high .status-notification-item-title {
    color: #ff6b6b;
}

.status-notification-item.severity-medium .status-notification-item-title {
    color: #f57c00;
}

body.dark .status-notification-item.severity-medium .status-notification-item-title {
    color: #ffa500;
}

.status-notification-item.severity-low .status-notification-item-title {
    color: #fbc02d;
}

body.dark .status-notification-item.severity-low .status-notification-item-title {
    color: #ffd700;
}

.status-notification-item-message {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

body.dark .status-notification-item-message {
    color: #e0e0e0;
}

.status-notification-item-message a {
    color: #1976d2;
    text-decoration: underline;
}

body.dark .status-notification-item-message a {
    color: #64b5f6;
}

.status-notification-popup-footer {
    padding: 1rem 1.5rem;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

body.dark .status-notification-popup-footer {
    background: #1f1f1f;
    border-top-color: #444;
}

.status-notification-popup-footer a {
    color: #1976d2;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark .status-notification-popup-footer a {
    color: #64b5f6;
}

.status-notification-popup-footer a:hover {
    color: #1565c0;
    text-decoration: underline;
}

body.dark .status-notification-popup-footer a:hover {
    color: #90caf9;
}

/* Floating Container for Button/Notification */
.status-floating-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.status-floating-container.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Floating Button for Active Issues */
.status-floating-button {
    background: #d32f2f;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(211, 47, 47, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    height: auto;
    overflow: hidden;
}

body.dark .status-floating-button {
    background: #ff6b6b;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.status-floating-button:hover {
    background: #b71c1c;
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.5);
    transform: translateY(-2px);
}

body.dark .status-floating-button:hover {
    background: #ff5252;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.status-floating-button:active {
    transform: translateY(0) scale(0.98);
}

.status-floating-button i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.status-floating-button span {
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

/* Floating Notification (expanded state) */
.status-floating-notification {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    max-width: 420px;
    width: 420px;
    max-height: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

body.dark .status-floating-notification {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.status-floating-notification .status-notification-popup-header {
    flex-shrink: 0;
}

.status-floating-notification .status-notification-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    margin-bottom: 0;
}

.status-floating-notification .status-notification-popup-footer {
    flex-shrink: 0;
}

/* Expanded state */
.status-floating-container.expanded .status-floating-button {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    border-radius: 16px 16px 0 0;
}

.status-floating-container.expanded .status-floating-notification {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.status-floating-container.expanded .status-floating-button i,
.status-floating-container.expanded .status-floating-button span {
    opacity: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .status-notification-popup {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .status-floating-container {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
    
    .status-floating-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .status-floating-button span {
        display: none;
    }
    
    .status-floating-button {
        border-radius: 50%;
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
    }
    
    .status-floating-button i {
        font-size: 1.5rem;
    }
    
    .status-floating-notification {
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 16px;
    }
}

