.notification-wrapper {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon {
    width: 50px;
    height: 50px;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: red;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.notification-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: right 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.notification-panel.active {
    right: 0;
}

.notification-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.notification-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #f5f5f5;
}

.notification-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    transition: background-color 0.2s;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item:active {
    background: #f0f0f0;
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eef3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.notification-item .icon i {
    font-size: 20px;
    color: #F45AB9;
}

.notification-item .content {
    flex: 1;
}

.notification-item .type {
    font-size: 12px;
    color: #F45AB9;
    margin-bottom: 4px;
    font-weight: 500;
}

.notification-item .message {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-item .time {
    font-size: 12px;
    color: #999;
}

#notificationOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

#notificationOverlay.active {
    opacity: 1;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #eee;
    border-top-color: #F45AB9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.notification-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.notification-empty p {
    margin: 0;
    font-size: 14px;
}

/* 모바일 대응 */
@media (max-width: 420px) {
    .notification-panel {
        max-width: 100%;
    }
    
    .notification-header {
        padding: 16px;
    }
    
    .notification-item {
        padding: 16px;
    }
}

/* iOS Safe Area 대응 */
@supports (padding-top: env(safe-area-inset-top)) {
    .notification-panel {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 알림 아이템 스타일 */
.notification-item {
    display: flex;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #f0f7ff;
}

.notification-item .noti-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: #eef3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.notification-item .noti-icon i {
    font-size: 18px;
    color: #F45AB9;
}

.notification-item .noti-content {
    flex: 1;
    min-width: 0; /* Flexbox 내에서 텍스트 줄바꿈을 위해 필요 */
}

.notification-item .noti-type {
    font-size: 13px;
    color: #F45AB9;
    margin-bottom: 4px;
    font-weight: 500;
}

.notification-item .noti-message {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-all;
}

.notification-item .noti-time {
    font-size: 12px;
    color: #999;
}

/* 읽지 않은 알림 표시 */
.notification-item.unread::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #F45AB9;
}

/* 빈 상태 스타일 */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.notification-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
    display: block;
}

.notification-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.all-read-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #666;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

.all-read-btn:hover {
    background-color: #f5f5f5;
}

/* 아이콘 색상 */
.notification-item .noti-icon i.fa-truck { color: #34C759; }
.notification-item .noti-icon i.fa-coins { color: #FFD60A; }
.notification-item .noti-icon i.fa-comment { color: #F45AB9; }
.notification-item .noti-icon i.fa-shopping-bag { color: #FF375F; }
.notification-item .noti-icon i.fa-bell { color: #5856D6; }