/**
 * Notification Dropdown - Mobile Responsive Styles
 * Improved UI for both desktop and mobile devices
 */

/* Notification Bell Button */
.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: #4a5568;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

body.dark-mode .notification-btn {
    color: #cbd5e0;
}

body.dark-mode .notification-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f7fafc;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #e53e3e;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* Notification Popup/Dropdown */
.notification-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.notification-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.dark-mode .notification-popup {
    background: #2d3748;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Notification Header */
.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .notification-header {
    border-bottom-color: #4a5568;
}

.notification-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

body.dark-mode .notification-header h3 {
    color: #f7fafc;
}

.mark-all-read {
    background: none;
    border: none;
    color: #4299e1;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.mark-all-read:hover {
    background: rgba(66, 153, 225, 0.1);
    color: #3182ce;
}

/* Notification List */
.notification-list {
    overflow-y: auto;
    max-height: 400px;
    flex: 1;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f7fafc;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

body.dark-mode .notification-list::-webkit-scrollbar-track {
    background: #1a202c;
}

body.dark-mode .notification-list::-webkit-scrollbar-thumb {
    background: #4a5568;
}

/* Notification Item */
.notification-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f7fafc;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item:hover {
    background: #f7fafc;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: #ebf8ff;
}

.notification-item.unread:hover {
    background: #bee3f8;
}

body.dark-mode .notification-item {
    border-bottom-color: #4a5568;
}

body.dark-mode .notification-item:hover {
    background: #374151;
}

body.dark-mode .notification-item.unread {
    background: #1e3a5f;
}

body.dark-mode .notification-item.unread:hover {
    background: #2c5282;
}

/* Notification Icon */
.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.notification-icon.user {
    background: #e6fffa;
    color: #319795;
}

.notification-icon.content {
    background: #fef5e7;
    color: #d69e2e;
}

.notification-icon.system {
    background: #fff5f5;
    color: #e53e3e;
}

body.dark-mode .notification-icon.user {
    background: #234e52;
    color: #81e6d9;
}

body.dark-mode .notification-icon.content {
    background: #5f370e;
    color: #fbd38d;
}

body.dark-mode .notification-icon.system {
    background: #63171b;
    color: #fc8181;
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2d3748;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

body.dark-mode .notification-title {
    color: #f7fafc;
}

.notification-message {
    font-size: 0.85rem;
    color: #718096;
    margin: 0 0 4px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

body.dark-mode .notification-message {
    color: #a0aec0;
}

.notification-time {
    font-size: 0.75rem;
    color: #a0aec0;
}

body.dark-mode .notification-time {
    color: #718096;
}

/* Empty State */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #a0aec0;
}

.notification-empty i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.notification-empty p {
    margin: 0;
    font-size: 0.9rem;
}

body.dark-mode .notification-empty {
    color: #718096;
}

/* Loading State */
.notification-loading {
    padding: 40px 20px;
    text-align: center;
    color: #a0aec0;
}

.notification-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Notification Footer */
.notification-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

body.dark-mode .notification-footer {
    border-top-color: #4a5568;
}

.notification-footer a {
    color: #4299e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.notification-footer a:hover {
    color: #3182ce;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        transform: translateY(100%);
    }

    .notification-popup.active {
        transform: translateY(0);
    }

    .notification-header {
        padding: 20px;
    }

    .notification-list {
        max-height: calc(70vh - 120px);
    }

    .notification-item {
        padding: 16px 20px;
    }

    /* Mobile backdrop */
    .notification-popup.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .notification-popup {
        width: 340px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .notification-header h3 {
        font-size: 0.95rem;
    }

    .mark-all-read {
        font-size: 0.8rem;
    }

    .notification-title {
        font-size: 0.85rem;
    }

    .notification-message {
        font-size: 0.8rem;
    }
}