/**
 * Task Marketplace - Notification Styles
 * Styles for notification system, dropdowns, and toasts
 */

/* Notification Button & Badge */
#tm-notifications-btn {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tm-notifications-btn:hover {
    background-color: rgba(0, 102, 204, 0.1);
}

#tm-notifications-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ff6b35;
    color: white;
    min-width: 18px;
    height: 20px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 16px;
    font-weight: bold;
    white-space: nowrap;
}

/* Notification Panel/Dropdown */
.tm-notifications-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 360px;
    max-height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tm-notifications-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Notification Panel Header */
.tm-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tm-notifications-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.tm-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.tm-close-btn:hover {
    color: #333;
}

/* Notification List */
.tm-notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.tm-notifications-list::-webkit-scrollbar {
    width: 6px;
}

.tm-notifications-list::-webkit-scrollbar-track {
    background: transparent;
}

.tm-notifications-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.tm-notifications-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Notification Item */
.tm-notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.tm-notification-item:hover {
    background-color: #f9f9f9;
}

.tm-notification-item.tm-notification-unread {
    background-color: #f0f5ff;
}

.tm-notification-item.tm-notification-unread:hover {
    background-color: #e8f0ff;
}

.tm-notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    min-width: 20px;
}

.tm-notification-content {
    flex: 1;
    min-width: 0;
}

.tm-notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-notification-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.tm-notification-time {
    font-size: 12px;
    color: #999;
}

.tm-notification-actions {
    flex-shrink: 0;
}

.tm-notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #0066cc;
    border-radius: 50%;
}

/* Empty Notifications */
.tm-empty-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.tm-loading {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Notification Panel Footer */
.tm-notifications-footer {
    padding: 12px 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.tm-view-all-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.tm-view-all-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Toast Notifications */
.tm-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 500px;
}

.tm-toast {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    animation: tm-toast-slide-in 0.3s ease;
}

@keyframes tm-toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.tm-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.tm-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.tm-toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.tm-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.tm-toast-close:hover {
    color: #333;
}

/* Toast Type Variations */
.tm-toast-success {
    border-left: 4px solid #00a651;
}

.tm-toast-error {
    border-left: 4px solid #ff6b35;
}

.tm-toast-warning {
    border-left: 4px solid #ffa500;
}

.tm-toast-info {
    border-left: 4px solid #0066cc;
}

/* Notification Center Page */
#tm-page-notifications {
    padding: 20px;
}

.tm-notifications-center-header {
    margin-bottom: 20px;
}

.tm-notifications-center-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.tm-notifications-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tm-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
}

.tm-filter-btn:hover,
.tm-filter-btn.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.tm-notifications-list-full {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tm-notification-item-full {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tm-notification-item-full:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.tm-notification-item-full.tm-notification-unread {
    background: #f0f5ff;
    border-color: #0066cc;
}

.tm-notification-item-full .tm-notification-icon {
    font-size: 24px;
}

.tm-notification-item-full .tm-notification-content {
    flex: 1;
}

.tm-notification-item-full .tm-notification-title {
    font-size: 15px;
    margin-bottom: 6px;
}

.tm-notification-item-full .tm-notification-text {
    font-size: 14px;
    -webkit-line-clamp: 3;
    margin-bottom: 8px;
}

.tm-notification-item-full .tm-notification-time {
    font-size: 12px;
}

.tm-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.tm-pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.tm-pagination-btn:hover {
    border-color: #0066cc;
    color: #0066cc;
}

.tm-pagination-btn.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.tm-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tm-notifications-panel {
        position: fixed;
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 70vh;
    }

    .tm-toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .tm-notification-item-full {
        flex-direction: column;
    }

    .tm-notifications-filters {
        flex-wrap: wrap;
    }
}

@media (max-width: 414px) {
    .tm-notifications-panel {
        width: 90vw;
        max-height: 60vh;
        right: 5vw;
    }

    .tm-notification-item {
        gap: 10px;
        padding: 10px 12px;
    }

    .tm-notification-content {
        flex-basis: 100%;
    }

    .tm-notification-title {
        font-size: 13px;
    }

    .tm-notification-text {
        font-size: 12px;
    }
}
