/* Message Bar Styles */
.message-bar-container {
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
}

.message-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8px 0;
    transition: transform 0.5s ease-in-out;
    position: relative;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.message-bar.desktop {
    /* Full width desktop version */
}

.message-bar.compact {
    /* Compact mobile version */
    padding: 4px 8px;
    min-height: 28px;
    border-radius: 4px;
    margin: 0 8px;
}

.message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.message-content i {
    color: var(--primary-color, #d4af37);
    font-size: 1rem;
}

.message-text {
    transition: opacity 0.3s ease;
}

/* Mobile Message Bar Inline with Navigation */
.mobile-message-bar {
    display: flex;
    align-items: center;
    overflow: hidden;
    flex: 1; /* Take remaining space after hamburger menu */
}

/* Sliding animation */
.message-bar.slide-up {
    transform: translateY(-100%);
}

.message-bar.slide-down {
    transform: translateY(0);
}

/* Mobile responsive */
@media (max-width: 991.98px) {
    .mobile-message-bar {
        max-width: calc(100% - 60px); /* Account for hamburger menu width */
    }
    
    /* Match hamburger menu button height to message bar */
    .navbar-toggler {
        height: 40px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        border-radius: 4px !important;
    }
    
    .message-bar.compact {
        padding: 4px 6px;
        min-height: 40px; /* Fixed height for 2 lines */
        max-height: 40px;
        font-size: 0.75rem;
        align-items: flex-start;
        width: 100%; /* Ensure full width */
        flex: 1; /* Take all available space */
    }
    
    .message-bar.compact .message-content {
        font-size: 0.75rem;
        justify-content: flex-start;
        align-items: flex-start;
        height: 100%;
        padding-top: 2px;
        width: 100%; /* Ensure content takes full width */
    }
    
    .message-bar.compact .message-content i {
        font-size: 0.8rem;
        margin-right: 4px !important;
        margin-top: 2px;
        flex-shrink: 0;
    }
    
    .message-bar.compact .message-text {
        font-size: 0.75rem;
        line-height: 1.2;
        white-space: normal; /* Allow text wrapping */
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Limit to 2 lines */
        -webkit-box-orient: vertical;
        text-overflow: ellipsis;
        max-height: 32px; /* 2 lines at 1.2 line-height */
    }
    
    /* Hide desktop version on mobile */
    .message-bar-container {
        display: none !important;
    }
}

@media (min-width: 992px) {
    /* Hide mobile version on desktop */
    .mobile-message-bar {
        display: none !important;
    }
    
    .message-bar.desktop {
        padding: 8px 0;
        min-height: 36px;
    }
    
    .message-bar.desktop .message-content {
        font-size: 0.9rem;
    }
    
    .message-bar.desktop .message-content i {
        font-size: 1rem;
    }
}

/* Color variations for different message types */
.message-bar.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #b8daff 100%);
    border-left: 4px solid #17a2b8;
}

.message-bar.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
}

.message-bar.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
}

.message-bar.promotion {
    background: linear-gradient(135deg, #fdf2e9 0%, #f4d03f 100%);
    border-left: 4px solid var(--primary-color, #d4af37);
}

/* Compact mobile versions with smaller borders */
.message-bar.compact.info {
    border-left: 2px solid #17a2b8;
}

.message-bar.compact.success {
    border-left: 2px solid #28a745;
}

.message-bar.compact.warning {
    border-left: 2px solid #ffc107;
}

.message-bar.compact.promotion {
    border-left: 2px solid var(--primary-color, #d4af37);
}

/* Countdown section styles */
.countdown-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.8rem;
}

.countdown-text {
    font-weight: 600;
    color: #dc3545;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace; /* Fixed-width font to prevent jumping */
    min-width: 80px; /* Reserve space for countdown */
    text-align: left;
    letter-spacing: 0.5px; /* Improve readability of monospace */
}

.end-time-text {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 1px;
    white-space: nowrap;
}

/* Mobile countdown adjustments */
@media (max-width: 991.98px) {
    .message-bar.compact .countdown-section {
        font-size: 0.7rem;
        align-self: flex-start;
        margin-top: 2px;
    }
    
    .message-bar.compact .countdown-text {
        font-size: 0.7rem;
        line-height: 1.1;
        min-width: 60px; /* Smaller reserved space for mobile */
    }
    
    .message-bar.compact .end-time-text {
        font-size: 0.65rem;
        line-height: 1.1;
    }
}

/* Desktop countdown adjustments */
@media (min-width: 992px) {
    .countdown-section {
        align-items: center;
        flex-direction: row;
        gap: 8px;
    }
    
    .end-time-text {
        margin-top: 0;
    }
}