/**
 * Push Notifications UI Styles
 * Permission prompts, notification badges, and settings
 */

/* Notification Permission Banner */
.notification-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #041E42 0%, #1a3a5c 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    max-width: 500px;
    width: calc(100% - 40px);
    display: none;
    animation: slideUp 0.3s ease-out;
}

.notification-banner.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.notification-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-description {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.notification-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.notification-btn-primary {
    background: #FFB81C;
    color: #041E42;
}

.notification-btn-primary:hover {
    background: #e5a519;
    transform: translateY(-1px);
}

.notification-btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.notification-btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.notification-close:hover {
    opacity: 1;
}

/* Notification Badge */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    display: none;
}

.notification-badge[data-count]:not([data-count="0"])::after {
    display: block;
}

/* Notification Bell Icon in Nav */
.notification-bell {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    color: #FFB81C;
}

.notification-bell.has-notifications {
    animation: ringBell 2s ease-in-out infinite;
}

@keyframes ringBell {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 360px;
    max-height: 480px;
    overflow: hidden;
    display: none;
    z-index: 1000;
}

.notification-dropdown.show {
    display: flex;
    flex-direction: column;
}

.notification-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-dropdown-title {
    font-size: 16px;
    font-weight: 600;
    color: #041E42;
}

.notification-dropdown-clear {
    font-size: 13px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.notification-dropdown-clear:hover {
    color: #041E42;
}

.notification-dropdown-list {
    flex: 1;
    overflow-y: auto;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    gap: 12px;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #fff8e6;
}

.notification-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-icon.goal {
    background: #28a745;
    color: white;
}

.notification-item-icon.news {
    background: #17a2b8;
    color: white;
}

.notification-item-icon.game {
    background: #FFB81C;
    color: #041E42;
}

.notification-item-content {
    flex: 1;
}

.notification-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #041E42;
    margin-bottom: 4px;
}

.notification-item-text {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-item-time {
    font-size: 12px;
    color: #999;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.notification-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.3;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 16px 20px;
    max-width: 360px;
    z-index: 10000;
    display: none;
    animation: slideInRight 0.3s ease-out;
}

.notification-toast.show {
    display: block;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-toast-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.notification-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFB81C;
    color: #041E42;
}

.notification-toast-title {
    font-size: 15px;
    font-weight: 600;
    color: #041E42;
    flex: 1;
}

.notification-toast-body {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Settings Toggle */
.notification-settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.notification-settings-label {
    font-size: 15px;
    color: #041E42;
}

.notification-settings-description {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.notification-toggle {
    position: relative;
    width: 48px;
    height: 28px;
    background: #ccc;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.notification-toggle.active {
    background: #28a745;
}

.notification-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.notification-toggle.active::after {
    transform: translateX(20px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .notification-banner {
        bottom: 70px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
    }

    .notification-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 12px 12px 0 0;
    }

    .notification-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .notification-banner {
        padding: 12px 16px;
    }

    .notification-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .notification-actions {
        width: 100%;
        justify-content: center;
    }

    .notification-btn {
        flex: 1;
    }
}
