/* Notification Styles */
.Notice,
.navbar-notice {
    position: relative;
}

.navbar-notice-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    text-decoration: none;
    color: #fff;
    min-width: 35px;
    min-height: 35px;
}

.navbar-notice-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-notice-toggle.has-notifications {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: notificationPulse 2s infinite;
}

.navbar-notice-toggle.has-notifications:hover {
    background: linear-gradient(135deg, #ff5252, #ff7043);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

/* Special styling for level up and badge notifications */
.notifi-item.level-up {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.1),
        rgba(118, 75, 162, 0.1)
    );
    border-left: 4px solid #667eea;
    animation: levelUpGlow 2s ease-in-out infinite alternate;
}

.notifi-item.new-badge {
    background: linear-gradient(
        135deg,
        rgba(240, 147, 251, 0.1),
        rgba(245, 87, 108, 0.1)
    );
    border-left: 4px solid #f093fb;
    animation: badgeSparkle 2s ease-in-out infinite alternate;
}

.notifi-item.level-up .notification-text {
    color: #a8c8ec;
}

.notifi-item.new-badge .notification-text {
    color: #f4a7f7;
}

.notifi-item.level-up .notification-text strong {
    color: #667eea;
    text-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.notifi-item.new-badge .notification-text strong {
    color: #f093fb;
    text-shadow: 0 0 5px rgba(240, 147, 251, 0.3);
}

/* Special animations for level up and badge notifications */
@keyframes levelUpGlow {
    0% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
        border-left-color: #667eea;
    }
    100% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
        border-left-color: #8a9ef3;
    }
}

@keyframes badgeSparkle {
    0% {
        box-shadow: 0 2px 8px rgba(240, 147, 251, 0.2);
        border-left-color: #f093fb;
    }
    100% {
        box-shadow: 0 4px 16px rgba(240, 147, 251, 0.4);
        border-left-color: #f4a7f7;
    }
}

/* Special icon styling for system notifications */
.notifi-item .notification-icon {
    font-size: 16px;
    margin-right: 5px;
    display: inline-block;
}

.notifi-item.level-up .notification-icon {
    animation: bounceIcon 1s ease-in-out infinite;
}

.notifi-item.new-badge .notification-icon {
    animation: rotateIcon 2s linear infinite;
}

@keyframes bounceIcon {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes rotateIcon {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.notification-icon {
    font-size: 18px;
    transition: all 0.3s ease;
}

.navbar-notice-toggle.has-notifications .notification-icon {
    animation: bellShake 0.8s ease-in-out infinite;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
    animation: countPulse 1.5s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 107, 107, 0.7);
    }
}

@keyframes bellShake {
    0%,
    100% {
        transform: rotate(0deg);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: rotate(-10deg);
    }
    20%,
    40%,
    60%,
    80% {
        transform: rotate(10deg);
    }
}

@keyframes countPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.manage-notifi {
    position: absolute;
    background: #0f1416;
    width: 400px;
    z-index: 9999;
    right: 0;
    margin-top: 5px;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none !important;
    border: 1px solid #181d1f;
    display: flex;
    flex-direction: column;
}

.manage-notifi.login-active {
    display: flex !important;
}

.notifications-content {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
}

.notifi-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    position: relative;
    transition: all 0.3s ease;
}

.notifi-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.notifi-item a {
    display: flex;
    color: #333;
    text-decoration: none;
}

.notifi-item a.not-read {
    font-weight: bold;
    background-color: rgba(33, 150, 243, 0.05);
}

.notifi-item-thumbnail {
    width: 70px;
    height: 70px;
    overflow: hidden;
    border-radius: 5px;
    margin-right: 10px;
}

.notifi-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notifi-item-info {
    flex: 1;
}

.notification-text {
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 4px;
}

.notification-text strong {
    font-weight: 600;
    color: #ffbe86;
}

.notification-time {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.notifi-item.unread .notification-text {
    font-weight: 500;
}

.notifi-item.unread .notification-text strong {
    color: #c0392b;
}

/* Server/Quality info styling */
.notification-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notification-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #999;
    cursor: pointer;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.notifi-item:hover .notification-delete {
    opacity: 1;
}

.notification-delete:hover {
    background-color: #f44336;
    color: #fff;
}

#clear-all-notif {
    position: relative;
    width: 100%;
    background: #181d1f;
    font-weight: bold;
    color: #ddd;
    text-align: center;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    font-size: 14px;
    border-bottom-right-radius: 8px;
    border-bottom-left-radius: 8px;
    margin-top: auto;
}

#clear-all-notif:hover {
    background: #252d30;
    transform: translateY(-1px);
}

#clear-all-notif:active {
    transform: translateY(0);
    background: #c5c5c5;
}

#clear-all-notif i {
    margin-right: 5px;
}

.success-message {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notifi-item {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notifi-item.deleting {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.empty-notification {
    padding: 20px;
    text-align: center;
    color: #777;
}

.loading {
    padding: 20px;
    text-align: center;
    color: #777;
}

.error {
    padding: 20px;
    text-align: center;
    color: #f44336;
}

/* Debug styles - temporary to help with dropdown visibility */
.navbar-notice.debug-active .manage-notifi {
    display: block !important;
    background: #fff !important;
    border: 2px solid red !important;
}

@media (max-width: 767px) {
    .manage-notifi {
        width: 300px;
        right: -50px;
    }

    #clear-all-notif {
        width: 100%;
    }

    .notifi-item-thumbnail {
        width: 50px;
        height: 50px;
    }

    .navbar-notice {
        position: relative;
    }

    .navbar-notice-toggle {
        min-width: 40px;
        min-height: 40px;
        padding: 8px 10px;
    }

    .notification-icon {
        font-size: 16px;
    }

    .notification-count {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        top: -4px;
        right: -4px;
    }
}
