/* TopBar Alert Styles */
#topbar-alert-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999; /* Tăng z-index để đè lên mọi thứ */
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.5s ease-out;
}

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

.topbar-alert-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 40px;
    padding: 0 50px;
}

.topbar-alert-item {
    display: none;
    width: 100%;
    animation: fadeIn 0.5s ease-in-out;
}

.topbar-alert-item.active {
    display: block;
}

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

.topbar-alert-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-alert-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

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

.topbar-alert-icon svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.topbar-alert-message {
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.topbar-alert-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: inherit;
    padding: 0;
}

.topbar-alert-close:hover {
    background: rgba(0, 0, 0, 0.25);
    transform: translateY(-50%) rotate(90deg);
}

.topbar-alert-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.topbar-alert-dots {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
}

.topbar-alert-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.topbar-alert-dots .dot.active {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.topbar-alert-dots .dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

/* Push body content down */
body.topbar-alert-visible {
    padding-top: 64px !important;
}

/* Admin bar adjustments */
body.admin-bar.topbar-alert-visible {
    padding-top: 96px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar.topbar-alert-visible {
        padding-top: 110px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #topbar-alert-container {
        padding: 10px 15px;
    }
    
    .topbar-alert-content {
        padding: 0 45px 0 10px;
        min-height: 36px;
    }
    
    .topbar-alert-message {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .topbar-alert-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .topbar-alert-close {
        width: 28px;
        height: 28px;
        right: 8px;
    }
    
    .topbar-alert-dots {
        position: static;
        transform: none;
        margin-top: 8px;
        justify-content: center;
        width: 100%;
    }
    
    .topbar-alert-content {
        flex-direction: column;
        padding: 0;
    }
    
    .topbar-alert-close {
        top: 10px;
        transform: none;
    }
    
    body.topbar-alert-visible {
        padding-top: 80px !important;
    }
    
    body.admin-bar.topbar-alert-visible {
        padding-top: 126px !important;
    }
}

@media (max-width: 480px) {
    .topbar-alert-message {
        font-size: 12px;
    }
    
    .topbar-alert-inner {
        gap: 8px;
    }
}

/* Print styles */
@media print {
    #topbar-alert-container {
        display: none;
    }
    
    body.topbar-alert-visible {
        padding-top: 0 !important;
    }
}