/**
 * Notification styles for the ModernCrowdFIIN platform
 */

/* Notification Icon */
.notification-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 1.2rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.notification-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-icon:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-icon i {
    color: #3b82f6;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #ffffff;
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 45px;
    right: -20px;
    width: 350px;
    max-width: 90vw;
    background-color: #1e293b;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 1px solid #334155;
    color: #f8fafc;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-dropdown:before {
    content: '';
    position: absolute;
    top: -8px;
    right: 28px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #0f172a;
}

.notification-dropdown:after {
    content: '';
    position: absolute;
    top: -9px;
    right: 27px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #334155;
    z-index: -1;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #334155;
    background-color: #0f172a;
}

.notification-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.notification-header h3:before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #3b82f6;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
}

.notification-header .view-all {
    color: #3b82f6;
    font-size: 0.8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.notification-header .view-all:after {
    content: '›';
    font-size: 1.2rem;
    margin-left: 3px;
    line-height: 1;
}

.notification-header .view-all:hover {
    color: #60a5fa;
}

.notification-body {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    background-color: #1e293b;
}

.notification-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-top: 1px solid #334155;
    background-color: #0f172a;
}

.notification-footer a {
    font-size: 0.9rem;
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.notification-footer a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Notification Items */
.notification-item {
    padding: 15px;
    border-bottom: 1px solid #334155;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: #0f172a;
}

.notification-item.unread {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
}

.notification-item:before {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-color: #3b82f6;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z'/%3E%3C/svg%3E");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-item.success:before {
    background-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.notification-item.warning:before {
    background-color: #007bff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

.notification-item.error:before {
    background-color: #dc3545;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

.notification-item-content {
    flex: 1;
    min-width: 0; /* Prevents text overflow issues */
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.notification-item-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.notification-date {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 10px;
    white-space: nowrap;
}

.notification-item p {
    margin: 5px 0 10px;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.notification-category {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(71, 85, 105, 0.2);
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.notification-category.SYSTEM {
    background-color: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.notification-category.INVESTMENT {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.notification-category.TRANSACTION {
    background-color: rgba(249, 115, 22, 0.2);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.notification-category.ACCOUNT {
    background-color: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.notification-category.GENERAL {
    background-color: rgba(71, 85, 105, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

/* Button styling for notification actions */
.notification-link {
    font-size: 0.8rem;
    color: #ffffff;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    background-color: #3b82f6;
    border: 1px solid #3b82f6;
    font-weight: 500;
    cursor: pointer;
}

.notification-link:hover {
    text-decoration: none;
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Make sure buttons in dropdown have consistent styling */
.notification-item-footer .btn {
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Loading, Empty, and Error States */
.notification-loading,
.notification-empty,
.notification-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    text-align: center;
    background-color: #1e293b;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 123, 255, 0.2);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.notification-loading p,
.notification-empty p,
.notification-error p {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.notification-empty {
    padding: 40px 15px;
}

.notification-empty:before {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aaaaaa'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 15px;
    opacity: 0.5;
}

.notification-error p {
    color: #ff3366;
}

.notification-error:before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 51, 102, 0.2);
    color: #ff3366;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .notification-dropdown {
        width: 300px;
        right: -100px;
        max-width: 90vw;
    }

    .notification-dropdown:before {
        right: 110px;
    }

    .notification-dropdown:after {
        right: 109px;
    }

    .notification-item-header h4 {
        max-width: 150px;
    }

    .notification-icon {
        width: 32px;
        height: 32px;
    }

    .notification-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .notification-dropdown {
        background-color: #222222;
        border-color: #333333;
    }

    .notification-dropdown:before {
        border-bottom-color: #222222;
    }

    .notification-dropdown:after {
        border-bottom-color: #333333;
    }

    .notification-header {
        background-color: #1a1a1a;
        border-bottom-color: #333333;
    }

    .notification-footer {
        background-color: #1a1a1a;
        border-top-color: #333333;
    }

    .notification-item {
        border-bottom-color: #333333;
    }

    .notification-item:hover {
        background-color: #2a2a2a;
    }
}
